Deleting point based on attribute?

   24943   19   5
User Avatar
Member
22 posts
Joined: March 2011
Offline
Hi,

I would like to delete points based on an attribute I am transferring. I thought I had it correct with the expression on the delete node

if(points(“../grabAtt”, $PT, “burned”) > 0)

How would I delete points that have a value on an attribute greater then 0?
User Avatar
Member
3158 posts
Joined: July 2007
Offline
you can use blast SOP
set Group Type to Points
and write this to Group Parm
@burned>0
if you want to go with Delete SOP's expression you can write this there
$BURNED > 0
if your attribute is bound to $BURNED variable
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi,
See attached. The variable I have created gives each point a 1 or 0 value. I then delete based on that value.

rob

Attachments:
rse_deletebyVar_01.hip (58.4 KB)

Gone fishing
User Avatar
Member
1719 posts
Joined: Oct. 2010
Offline
and also just for the sake of information, I believe your expression should be:

if(point(“../grabAtt”, $PT, “burned”, 0) > 0, 1, 0)

the if() function syntax is as such:

if(condition, true value, false value)

although in the case of the delete SOP, you do not need the if function. This would suffice:

point(“../grabAtt”, $PT, “burned”, 0) > 0

hope this helps!
-G
User Avatar
Member
370 posts
Joined: Nov. 2005
Offline
I recommend to avoid expressions as much as possible, they are the slowest way.

delete operation on a 5mill point cloud with point expression( point(“../node”, $PT, “value”,0) ) takes about 11 secs, using just a simple coparison ($VALUE > 0.5) takes about 3 secs.
the fastes way is with vops , just use vops to put the points into a group and delete them with that group (less than a second)

Martin
User Avatar
Member
22 posts
Joined: March 2011
Offline
Thanks for the info everyone! It helped!
User Avatar
Member
41 posts
Joined: Feb. 2014
Offline
sanostol
I recommend to avoid expressions as much as possible, they are the slowest way.

delete operation on a 5mill point cloud with point expression( point(“../node”, $PT, “value”,0) ) takes about 11 secs, using just a simple coparison ($VALUE > 0.5) takes about 3 secs.
the fastes way is with vops , just use vops to put the points into a group and delete them with that group (less than a second)

Martin

Very useful, you just save 11+ seconds!!
User Avatar
Member
15 posts
Joined: July 2015
Offline
sanostol
I recommend to avoid expressions as much as possible, they are the slowest way.

delete operation on a 5mill point cloud with point expression( point(“../node”, $PT, “value”,0) ) takes about 11 secs, using just a simple coparison ($VALUE > 0.5) takes about 3 secs.
the fastes way is with vops , just use vops to put the points into a group and delete them with that group (less than a second)

Martin


Hi Sanostol!
would you mind put an example hip of the delete using vop method?
thanks in advance!
User Avatar
Member
4 posts
Joined: Nov. 2013
Offline
in a point wrangle:


if (f@burned>0)
removepoint(0,i@ptnum);
User Avatar
Member
15 posts
Joined: July 2015
Offline
milesvignol
in a point wrangle:


if (f@burned>0)
removepoint(0,i@ptnum);

Hi milesvignol,
thanks for the reply!

what should i add to the code if i want to apply the deletion to a certain group only?
User Avatar
Member
1790 posts
Joined: Feb. 2012
Offline
Set the Group parameter of the Wrangle node to your group.
Senior Houdini FX TD @ MPC

https://www.patreon.com/animatrix [www.patreon.com]

http://vimeo.com/pusat [vimeo.com]
http://www.linkedin.com/in/lighttd/ [www.linkedin.com]
User Avatar
Member
15 posts
Joined: July 2015
Offline
ops:
sorry for the silly quest. I was focusing too much on the code part..
thank you very much!
User Avatar
Member
33 posts
Joined: Jan. 2016
Offline
Hi Sanostol!
would you mind put an example hip of the delete using vop method?
thanks in advance!
Thanks for all the answers but I would also love to see how to convert point attributes to group. To be able to delete given points or just use the groups for materials (I would love to learn both methods).

Details:
What I'm trying to do (a complete noob in Houdini):
I'm learning how to create terrains in H15, I've watched all GoProcedural tutorials and masterclasses on that topic, but the problem I have:
I created a “grass” attribute like in this great tutorial:
https://vimeo.com/65747175 [vimeo.com]

So now I can control where I want to have grass/trees/other stuff. And here is the problem: I would love to be able to use a material/materials based on attributes like that. As far as I understand one can assign materials to different groups sooooooooo I have to convert an attribute to a group, right? How can I do that? The deleting-point-by-attributes route got me stuck as well.

Please help

https://facebook.com/madfusionVisuals [facebook.com]
https://www.artstation.com/loogas [www.artstation.com]
https://www.linkedin.com/in/lstolarski/ [www.linkedin.com]
https://vimeo.com/loogas [vimeo.com]
User Avatar
Member
131 posts
Joined: March 2014
Offline
Hi check out Partition SOP.
User Avatar
Member
6 posts
Joined: Feb. 2018
Offline
Hi,

I had this problem but deleting by attribute AND from a certain frame only.

Can I activate the Blast SOP from a certain frame, or do I need to use point wrangle and if yes, what kind a expression I can use ?

In my Blast SOP : @depth>0

In my PointWrangle which isn't working : if($F < 2) {
@active = ch(“/obj/fluidtank_initial/blast_outside”, 1);

} else {
@active = ch(“/obj/fluidtank_initial/blast_outside”, 0);

}

Thomas
FX Student fallen in love with Houdini <3
User Avatar
Member
211 posts
Joined: Jan. 2015
Offline
Hi Thomas,
you can use a switch (node) to turn something on and off…
You plug in the source that goes into the blast and you connect the blast.
Now you can animate the switch…

regards

Olaf
User Avatar
Member
161 posts
Joined: Feb. 2012
Offline
Also you cant use $F in Vex it should be @Frame btw.
User Avatar
Member
6 posts
Joined: Feb. 2018
Offline
Ok sepu I tried with @Frame but my VEX doesn't work so I used the Switch method from Olaf.

Thanks for fast replies

If anyone has time to explain why my VEX isn't working, feel free to do so


Thomas
FX Student fallen in love with Houdini <3
User Avatar
Member
3158 posts
Joined: July 2007
Offline
what are you trying to do in your VEX?
I highly doubt that you are really trying to sample channel at different than current time so already ch() function with 2 arguments is wrong
can you describe what if was supposed to do before frame 2?
setting @active to any value doesn't sound like deleting by an attribute
if you want to delete by an attribute and only before frame 2 it'd look like this
if (@Frame<2 && @P.x<0) removepoint(0, @ptnum);
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
10 posts
Joined: Nov. 2016
Offline
Hi everyone !

I think that my question have connections with this thread. I want to delete some elements (cloth, rbd) depending on their active attribut.
From here, nothing difficult but I want to apply a “delay” on the delete. Like delete elements after an amount of time activation (similar to age for particles) AND with randomness in this delay.

I wonder if i can give float value to activation? Because now it's strictly 0 or 1. And maybe use that in wrangle:

if (@active > ch('threshold')){
removepoint(0,@ptnum);
}


Maybe wrong code, I'm pretty new with vex… and with that there isn't randomness too.

EDIT: stupid question about float value. I guess that an object can just be active or inactive. Maybe more on the way “age of activation”?
Edited by Arch - May 16, 2018 09:51:41
  • Quick Links