Jump to content

if (pt with attribute value dies, all pts with same att value die)


WLVL

Recommended Posts

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

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

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...