Jump to content

rand(@ptnum)>0.5 ----> Is this possible in blast SOP?


Recommended Posts

Hey guys, I was wondering if anyone knows how to delete rand points/prims with `rand()` in blast SOP.

 

For some reason I couldn't get it to work:

 

`rand(@ptnum)`>0.5

 

so I did this..

 

@id>`fit(0.5,0,1,1,npoints(opinputpath(".",0)))`

 

but I guess there are chases where I dont/cant use id.

 

Thanks!

Link to comment
Share on other sites

you can't do that directly in group parm, but just use wrangle to compute the value as an attribute like:

i@delete = rand(@ptnum)>0.5;

 

then blast by that attribute:

@delete=1

 

I remember Blast SOP being faster than removing geometry in VEX

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

use a point wrangle:

 

if (rand(@ptnum)>.5)

    removepoint(0,@ptnum);

 

 

edit: it'd be interesting to see if the two step approach is faster (flag/blast vs remove in vex)

Edited by fathom
Link to comment
Share on other sites

Yes, indeed the blast SOP is faster.

 

you can't do that directly in group parm, but just use wrangle to compute the value as an attribute like:

i@delete = rand(@ptnum)>0.5;

 

then blast by that attribute:

@delete=1

 

I remember Blast SOP being faster than removing geometry in VEX

 

I have been doing the same way so far too. I was just wondering if one step was possible. Thanks for the answer!

 

 

use a point wrangle:

 

if (rand(@ptnum)>.5)

    removepoint(0,@ptnum);

 

 

edit: it'd be interesting to see if the two step approach is faster (flag/blast vs remove in vex)

 

Alright, I will do a test to see which one is faster. I ll post the results!

 

Thanks again!

Link to comment
Share on other sites

you can't do that directly in group parm, but just use wrangle to compute the value as an attribute like:

i@delete = rand(@ptnum)>0.5;

 

then blast by that attribute:

@delete=1

 

I remember Blast SOP being faster than removing geometry in VEX

 

 

Yes, just like you said it faster to use blast then removeing geo in VEX, thanks guys.

 

 

Almost twice as much: (7M points)

 

 

post-10187-0-33605200-1459457907_thumb.j

Link to comment
Share on other sites

Yes, just like you said it faster to use blast then removeing geo in VEX, thanks guys.

 

 

Almost twice as much: (7M points)

 

 

attachicon.gifblastvatw.jpeg

 

I think it may depend on how much you're removing from what... I just found that removing primitives in a primitive wrangle was notably faster *if* I was removing a small number of prims from an object with a large number of them (deleting ~20,000 from ~1,000,000)

If I was deleting the majority of them, it was notably faster using Blast (deleting ~980,000 of ~1,000,000)

 

No idea why!

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