Jump to content
Sign in to follow this  
ela1995

how to for each primitive with vex

Recommended Posts

you can do this for example in point wrangle after your Connectivity SOP
 

int class = prim(0, "class", @primnum);   // get class of point's prim
string grp = sprintf("@class=%s", class);  // ad-hoc group string for all prims with that class value
vector rbb = relbbox(0, grp, @P);  // rel bbox of point's p within bbox of all prims in that group
v@Cd = chramp('color',rbb.y);  // profit

 

how_to_foreach_prim_with_vex_fix.hip

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×