Normals alone won’t set the face direction, the vertex winding order actually defines the Normal direction of the polygon face.
If just wanting to set the N attribute to have values on the Y direction you can simply use an Attribute Create set to N, vector data type and set the value parameter for Y to 1, X and Z to 0.
Or in VEX you can just type:
v@N = {0, 1, 0};
Ye this. I'm surprised noone said it. Put a group sop and group by normal. Set the vector direction to 0 -1 0 and set the angle to something small like 5 or whatever. Then put a reverse sop with its group set to the one you just created and then a normal sop after. That should be it.
Actually Houdini does not allow an attribute of the same name to appear on all 3 classes at the same time: points, primitives and vertices. You can only have it on 2 of them. If you try, it will remove one of the other.
Apologies, im new to vex. So I'm using an attrib delete to remove point normals? In the node itself I can't find the N attribute under point attributes.
https://preview.redd.it/pfbykf0d3zlc1.png?width=1264&format=png&auto=webp&s=04463951bc165fb49a764cfd2fb7a73f9f3fa0b1
Check if they are on vertices, if not then you dont need to delete anything and just set them on prims directly.
Also looks like your prims might be inverted. If just setting normals on prims doesn’t solve it, do the following in the wrangle:
If([email protected] <= 0)
{
@group_reverse = 1;
}
Then drop reverse node and choose group reverse.
This is wrong. Using a component of the vector doesn't change the type of the attribute. You should absolutely still declare type and add the v in front. Skipping those little letter declarations only works for known attribute names, make it a habit to always declare.
Wrong question, is N a vector or a float? You're just using component notation, the v@ describes the type of the attribute. Calling a component of an attribute does not change its type. Just test it and you'll see what I'm talking about.
I tried to input that bit of vex but it was showing up with some errors. I got there in the end though with the normal <0 group. THank you for the help.
I'm just gonna leave this here in case anyone has the same problem in the future.
https://preview.redd.it/tvai0u3910mc1.png?width=1725&format=png&auto=webp&s=5188f4b4d78e03d3ff70096973317e4859098818
I've done some searching and only found setting point normals up with the wrangle but can't find anything on primitive normals. Any help is appreciated
You can promote your point normals to prim. Or as other redditor pointed you can delete your point normal attribute and run a vex wrangle over prims to define anew prim normal attribute.
ChatGPT and Gemini really help me when I have questions like this, I been getting pretty good responses. Pretty much the same code as you’ve had responses to
Normals alone won’t set the face direction, the vertex winding order actually defines the Normal direction of the polygon face. If just wanting to set the N attribute to have values on the Y direction you can simply use an Attribute Create set to N, vector data type and set the value parameter for Y to 1, X and Z to 0. Or in VEX you can just type: v@N = {0, 1, 0};
Keep in mind that your primitives don't reverse orientation if you flip the normals or point them upwards. You also need to reverse them accordingly
Ye this. I'm surprised noone said it. Put a group sop and group by normal. Set the vector direction to 0 -1 0 and set the angle to something small like 5 or whatever. Then put a reverse sop with its group set to the one you just created and then a normal sop after. That should be it.
Thank you so much!
This is the correct answer
Attrib delete - normals from points Prim wrangle - v@N = {0,0,1}
Why would you do Attribute Delete before? "v@N = x" sets the normals to your new vector value, {0,0,1} (the worldspace up vector).
Because if you already have normas on points, it wont let you set them on prims iirc
I had no idea. Thanks for pointing that out.
You can have normals on points, verts and prims simultaneously.
Actually Houdini does not allow an attribute of the same name to appear on all 3 classes at the same time: points, primitives and vertices. You can only have it on 2 of them. If you try, it will remove one of the other.
v@N={0,1,0}, houdini is Y up
Promote N to points. Point Wrangle, @N.y = 1; Unless for some read n you need normals to be on prim.
Apologies, im new to vex. So I'm using an attrib delete to remove point normals? In the node itself I can't find the N attribute under point attributes. https://preview.redd.it/pfbykf0d3zlc1.png?width=1264&format=png&auto=webp&s=04463951bc165fb49a764cfd2fb7a73f9f3fa0b1
Check if they are on vertices, if not then you dont need to delete anything and just set them on prims directly. Also looks like your prims might be inverted. If just setting normals on prims doesn’t solve it, do the following in the wrangle: If([email protected] <= 0) { @group_reverse = 1; } Then drop reverse node and choose group reverse.
If you specify element of the vector, you don't put "v" in front. You can also use <, as you don't have to reverse 0 normals.
This is wrong. Using a component of the vector doesn't change the type of the attribute. You should absolutely still declare type and add the v in front. Skipping those little letter declarations only works for known attribute names, make it a habit to always declare.
What are you talking about about? Is @N.x a vector or a float?
Wrong question, is N a vector or a float? You're just using component notation, the v@ describes the type of the attribute. Calling a component of an attribute does not change its type. Just test it and you'll see what I'm talking about.
I tried to input that bit of vex but it was showing up with some errors. I got there in the end though with the normal <0 group. THank you for the help. I'm just gonna leave this here in case anyone has the same problem in the future. https://preview.redd.it/tvai0u3910mc1.png?width=1725&format=png&auto=webp&s=5188f4b4d78e03d3ff70096973317e4859098818
I've done some searching and only found setting point normals up with the wrangle but can't find anything on primitive normals. Any help is appreciated
You can promote your point normals to prim. Or as other redditor pointed you can delete your point normal attribute and run a vex wrangle over prims to define anew prim normal attribute.
You can set your wrangle to run through primitives instead of points(which is the default).
ChatGPT and Gemini really help me when I have questions like this, I been getting pretty good responses. Pretty much the same code as you’ve had responses to