Dear friends,
Would like your suggestions and help for a method to select voronoi fractured pieces by painting some points of the chosen pieces.
In the example file attached, I have fractured a box, then coloured it all black, painted some points of my chosen pieces with red, then promoted the Cd point attribute to primitives. This helps to spread the color to other points of the pieces but doesn't reach all of the connected primitives of the piece. The deletion at the end to just to isolate the chosen pieces but you will see I will not get the entire piece unless I paint every point of the piece.
I did try to use a foreach loop with attribute wrangle to go though each piece but can't seem to get the right code. Maybe I am heading the wrong direction cos there could be a simpler method.
Appreciate your suggestions.
MiKE
Selecting Fractured Pieces by Painting
4346 5 0- michaelngeb
- Member
- 9 posts
- Joined: 4月 2009
- Offline
- edward
- Member
- 7871 posts
- Joined: 7月 2005
- Offline
Sorry, no time to open .hip files anymore these days. What you describe sounds like what I would first try as well. I forget now but is there a primitive attribute for the connected pieces? If not, you always append a Connectivity SOP to generate the primitive id for each connected piece. So now use an Attribute Wrangle in Detail mode to loop through all the primitives in the VEX code. When it finds a red primitive, it records the connected piece id and breaks out of the loop. Now it does another loop and sets all the primitives with the same piece id to red.
- tamte
- Member
- 8785 posts
- Joined: 7月 2007
- Offline
just create primitive Wrangle
connect voronoifracture1 as a first input
and delete1 as second
it basically looks at the second input geo, tries to find a prim with the same name attrib as current prim, and if none exists it will delete current prim
essentially it will keep the whole piece if there is at least one prim from that piece in the second input geo
if (nametoprim(1, s@name) == -1 ) removeprim(0, @primnum, 1);
and delete1 as second
it basically looks at the second input geo, tries to find a prim with the same name attrib as current prim, and if none exists it will delete current prim
essentially it will keep the whole piece if there is at least one prim from that piece in the second input geo
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- michaelngeb
- Member
- 9 posts
- Joined: 4月 2009
- Offline
Hi edward
Thanks for the suggestion, I'm kinda lost in the VEX wrangling/coding world. I tried putting this code in the attribute wrangle after a connectivity node that gives me the ‘class’ attribute for each piece. But alas not getting the results. Some more advice please…
Run Over : Details(once only)
VEXpression:
if(@Cd[1]>0) i@redpiece=primattrib(0,“class”, @primnum,i@success);
if(@class==@redpiece) @Cd=set(0,1,0); //change to green to see better difference
Many thanks
MiKE
Thanks for the suggestion, I'm kinda lost in the VEX wrangling/coding world. I tried putting this code in the attribute wrangle after a connectivity node that gives me the ‘class’ attribute for each piece. But alas not getting the results. Some more advice please…
Run Over : Details(once only)
VEXpression:
if(@Cd[1]>0) i@redpiece=primattrib(0,“class”, @primnum,i@success);
if(@class==@redpiece) @Cd=set(0,1,0); //change to green to see better difference
Many thanks
MiKE
Edited by michaelngeb - 2017年3月31日 01:32:46
- michaelngeb
- Member
- 9 posts
- Joined: 4月 2009
- Offline
- hilmihalim_vfx
- Member
- 1 posts
- Joined: 12月 2016
- Offline
-
- Quick Links