Jump to content

Delete by highest attribute procedurally


hampuseh

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?

 

 

Link to comment
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);

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