Jump to content
Sign in to follow this  
Nemiko

Group create vex removeprim

Recommended Posts

 

Guys, please help, I can’t understand how to write the conditions for creating groups, so that after deleting a primitive, a group is created for primitives that have been deleted and those that have not been deleted

image.png.ace60c9cc8e28e27cf53c4935816e3e9.png

Share this post


Link to post
Share on other sites

Hi Nemiko,

Just from your example,

In the first line of your code you are comparing a string to and int which wont work,

You also cant add a primitive to a group if it doesnt exist,  So to simplify things I would first add the prims that you want to delete to a group then delete them outside of thte wrangle.

In your second if statement you are also using @ptnum where the function is expecting a primitive number (@primnum).

There also seems to be a mixture of incorrect attribute types.

Not knowing the full context, I would say that your wrangle should look more like ths :

if ( @name == "-1") 
    {
    setprimgroup(0,"myprimgroup",@primnum,1,"set");
    }

this will add any prim to the the group "myprimgroup" that has an attibute value of "-1" for the name attribute.

Then you can just delete it after the wrangle.

Hope this helps

R

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×