Jump to content
hampuseh

Delete by highest attribute procedurally

Recommended Posts

Greetings!

I have a system that creates an x amount of layers, I also apply a integer attribute value to each layer. 0-x

For example I may have done a 10 layer thing. which will give me 0-9 attribute.

My question is; How do I procedurally always delete the last layer with the highest attribute value?

 

 

Share this post


Link to post
Share on other sites

Easiest way is to promote your attribute to detail, set to maximum - set the new name to eg max_layer and don't delete original attribute -  then do something like the following in a wrangle: [assuming it's a prim integer attribute called 'layer', set the wrangle to run over prims]

 

if(i@layer == detail(0, "max_layer", 0)) removeprim(0, @primnum, 1);

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

×