Jump to content

VEX - delete by attribute


Juzwa

Recommended Posts

Hi, 

 

I've created primitive attributes on most of the pieces of my model. So when it comes to fracturing I can split the geo very fast by attribute.

 

I think it needs to be done in delete SOP, primitives entity, expression or pattern, maybe a foreach. But I'm not sure what is the expression that I need to do that. I tried to set each attribute some value and then use this:

@myAttribute > 0

But It does not work and I know why. I think I need sth like:

if (currentAttribute == @myAttribute)
Edited by Juzwa
Link to comment
Share on other sites

If you use a blast node:

@myAttribute > 0 without the spaces "@myAttribute>0" should work.

 

Or if your attribute has also been declared as a variable "$MYATTRIBUTE>0.5" should work in a delete node in the filter expression parameter.

In my experience, using the blast node has much faster results.

Link to comment
Share on other sites

Reply to original topic (VEX - delete by attribute)

 

VEX solution:

drop down an attribwrangle then enter this code:

if(@myAttribute > 0)
removeprim(geoself(), @primnum, 1); // if you want to delete points owned by primitive itself

or

if(@myAttribute > 0)
removeprim(geoself(), @primnum, 0);
  • Like 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...