Point Cut by using Wrangle
4808 8 0-
- ferilous
- Member
- 27 posts
- Joined: March 2017
- Offline
-
- Sadjad Rabiee
- Member
- 1391 posts
- Joined: Dec. 2010
- Offline
-
- ferilous
- Member
- 27 posts
- Joined: March 2017
- Offline
-
- anon_user_00157425
- Member
- 45 posts
- Joined: Feb. 2014
- Offline
I think you just need to make you lower case c an upper case C. @Cd is a built in attribute type for color.
Otherwise to create an attribute ‘cd’ you would need to write ‘v@cd’ the v tells the VEX compiler to create a vector3 attribute. There's also f@ for float, i@ for integer, p@ for vector4, u@ for vector2, and then you can add for array attributes like i@ for int array and so on.
@Cd is a ‘built in’ type like @P, @N, @ptnum(if your looping over points), @primnum for prims, @vertnum for vertices, they are the same variables that the VOP context provides.
The VEX Wrangle docs are here http://www.sidefx.com/docs/houdini/vex/snippets [www.sidefx.com] The VEX Wrangle syntax is a bit difficult , and quite frustrating to understand at first but it's simple once you learn it.
Otherwise to create an attribute ‘cd’ you would need to write ‘v@cd’ the v tells the VEX compiler to create a vector3 attribute. There's also f@ for float, i@ for integer, p@ for vector4, u@ for vector2, and then you can add for array attributes like i@ for int array and so on.
@Cd is a ‘built in’ type like @P, @N, @ptnum(if your looping over points), @primnum for prims, @vertnum for vertices, they are the same variables that the VOP context provides.
The VEX Wrangle docs are here http://www.sidefx.com/docs/houdini/vex/snippets [www.sidefx.com] The VEX Wrangle syntax is a bit difficult , and quite frustrating to understand at first but it's simple once you learn it.
-
- ferilous
- Member
- 27 posts
- Joined: March 2017
- Offline
-
- jsmack
- Member
- 8104 posts
- Joined: Sept. 2011
- Offline
-
- anon_user_00157425
- Member
- 45 posts
- Joined: Feb. 2014
- Offline
In this particular case you could use an attribute promote node to change uv to a point attribute, without any issues since their are no UV seams.
Or you could use,
vector uv = vertex(0, “uv”, pointvertex(0, @ptnum));
to get the get the current points first vertex number ‘pointvertex(0, @ptnum)’ then query the vertex attribute ‘vertex(0, “uv”, vertnum)’.
Then simply change @uv.x, @uv.y to uv.x and uv.y since it's no longer an attribute and just a local variable, since we didn't use the ‘@’ symbol in it's declaration ‘vector uv’, whereas we could say ‘v@uv = vertex(0, “uv”, pointvertex(0, @ptnum))’ to create a point attribute named ‘uv’.
Or you could use,
vector uv = vertex(0, “uv”, pointvertex(0, @ptnum));
to get the get the current points first vertex number ‘pointvertex(0, @ptnum)’ then query the vertex attribute ‘vertex(0, “uv”, vertnum)’.
Then simply change @uv.x, @uv.y to uv.x and uv.y since it's no longer an attribute and just a local variable, since we didn't use the ‘@’ symbol in it's declaration ‘vector uv’, whereas we could say ‘v@uv = vertex(0, “uv”, pointvertex(0, @ptnum))’ to create a point attribute named ‘uv’.
-
- ferilous
- Member
- 27 posts
- Joined: March 2017
- Offline
-
- wantnon
- Member
- 9 posts
- Joined: Sept. 2018
- Offline
Thomas Bishop@vertnum or @vtxnum?
In this particular case you could use an attribute promote node to change uv to a point attribute, without any issues since their are no UV seams.
Or you could use,
vector uv = vertex(0, “uv”, pointvertex(0, @ptnum));
to get the get the current points first vertex number ‘pointvertex(0, @ptnum)’ then query the vertex attribute ‘vertex(0, “uv”, vertnum)’.
Then simply change @uv.x, @uv.y to uv.x and uv.y since it's no longer an attribute and just a local variable, since we didn't use the ‘@’ symbol in it's declaration ‘vector uv’, whereas we could say ‘v@uv = vertex(0, “uv”, pointvertex(0, @ptnum))’ to create a point attribute named ‘uv’.
-
- Quick Links