Question : for each primitive in vex
341 4 0- A-kun
- Member
- 7 posts
- Joined: May 2018
- Offline
- jsmack
- Member
- 7814 posts
- Joined: Sept. 2011
- Offline
I'm not sure what you're after, but you don't need a for each loop block in sops just to enumerate primitives in VEX. On the wrangle, change the run over to primitive, and @primnum will be the number of the current primitive. The for each loop block is only needed for isolating parts of the geometry and running a set of nodes over each isolated part.
- A-kun
- Member
- 7 posts
- Joined: May 2018
- Offline
- tamte
- Member
- 8599 posts
- Joined: July 2007
- Offline
if your primitives are all separate you can do this in Point Wrangle
if any of the points is shared among multiple primitives it will get the vertex index value from first connected primitive
i@get = vertexprimindex(0, @vtxnum);
if any of the points is shared among multiple primitives it will get the vertex index value from first connected primitive
Edited by tamte - May 5, 2024 20:21:26
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- animatrix_
- Member
- 4531 posts
- Joined: Feb. 2012
- Offline
A-kun
Hi I simply want to have the same pointNumber between distant primitives. so I used foreach node to run the wrangle to get the same numver between them but I feel this is not smart way so would like to do the same thing just in vex.
If you mean to get the same point indices between different prims, you can just create a new points array for each prim like so:
int indices [ ] = array ( ); int pts [ ] = primpoints ( 0, @primnum ); foreach ( int index; int pt; pts ) append ( indices, index ); i[]@indices = indices;
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
-
- Quick Links