WLVL Posted January 10, 2016 Share Posted January 10, 2016 (edited) Hello!! I have a bunch of points with an attribute called name_id (integer) Some of the points share the same attribute value. As time goes on some of the points die/are deleted. I would like that when a point with a certain name_id value dies, all the other points that shared that same attribute value die. in the hip file you'll find 2 methods one with the foreach VOP one with foreach SOP (less interested in this one because i have to promote name_id to a prim att) -i am iterating throught each value of the name_id attribute -finding how many have that same name_id with findattribvalcount VOP -comparing how many there are at frame 1 with how many at current frame -if there are less then there were initially -> @dead = 1 i can't make it work it seems like the last iteration of the foreach overwrites all the previous. Can you please help me achieve what i want? thanks in advance if pt with attribute value dies all pts with same att value die.hip Edited January 10, 2016 by WLVL Quote Link to comment Share on other sites More sharing options...
f1480187 Posted January 11, 2016 Share Posted January 11, 2016 (edited) Something like this? I compared attribute value counts on before and after geometries. delete_dead.hipnc Edited January 11, 2016 by f1480187 Quote Link to comment Share on other sites More sharing options...
WLVL Posted January 11, 2016 Author Share Posted January 11, 2016 Hi f1480187! Thank you very much! So the for loop wasn't necessary at all! is there a way to findattvaluecount for just a certain frame? in general is it possibile to make a vex function operate just on a certain frame? in my case for example i'd like to get that i@count on the first frame. otherwise ill use a timeshift and attribute copy like in this hip im attaching thanks again delete_dead_freezeframe.hipnc Quote Link to comment Share on other sites More sharing options...
f1480187 Posted January 11, 2016 Share Posted January 11, 2016 Time Shift is the most straightforward way, IMHO. There is @Frame and @Time variables for doing time-dependent stuff, but there is no way to use it directly instead of timeshifting. If you wanted to achieve this result, you did well. delete_dead_freezeframe_minor_fix.hipnc Quote Link to comment Share on other sites More sharing options...
WLVL Posted January 11, 2016 Author Share Posted January 11, 2016 thanks again! PS: i didnt know about the enumerate SOP, very handy! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.