Jump to content
berkhak

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!

Share this post


Link to post
Share on other sites

if i need to use an expression for deleting geo i use the Delete SOP (Operation > Delete by expression).

Share this post


Link to post
Share on other sites

It's much faster to delete in VEX than Delete SOP, but it's not because of the delete, as the delete operation is not multi-threaded in both cases.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
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!

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

×