Jump to content

python / hscript testing if attribute is equal to any numbers of given


Tyfx567

Recommended Posts

Hey guys!! 

 

I am wanting to make it to where I can make a list like my_list = [12,13,15,18,19]       and if a point attribute equals any or all  of those numbers then it will add those points that have that attribute to a group.

 

I want to create multiple groups that have multiple particle systems attached to each group. If you look at my scene file you will see what I am trying to do along with examples of things I have tried to do. 

Similar to in python: (I am brand new to scripting so forgive me)

 

my_list = [12,13,18,19]

for num in my_list:

    if(@class == num):

            ingroup =1;

 

I know I am mixing the two codes together but that is exactly what I am trying to do. Preferably I can do this in a pop wrangle since I am doing pops in this. 

 

I know I can do:

if(@class == 13){ ingroup = 1;}

else if(@class == 14) {ingroup = 1;}

 

but that is really slow and not dynamic enough especially if I want to make multiple groups

 

Thanks so much guys! Any feedback is appreciated!!

Class pop network.hiplc

Edited by Tyfx567
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...