Jump to content

how to for each primitive with vex


ela1995

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...