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?
Deleting point based on attribute?
70650 19 6- tex1820
- Member
- 22 posts
- Joined: 3月 2011
- Offline
- tamte
- Member
- 8780 posts
- Joined: 7月 2007
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: 10月 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!
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
- sanostol
- Member
- 577 posts
- Joined: 11月 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
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
- tex1820
- Member
- 22 posts
- Joined: 3月 2011
- Offline
- pedro3145
- Member
- 41 posts
- Joined: 2月 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!!
- wlvl
- Member
- 23 posts
- Joined: 7月 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!
- milesvignol
- Member
- 4 posts
- Joined: 11月 2013
- Offline
- wlvl
- Member
- 23 posts
- Joined: 7月 2015
- Offline
- animatrix_
- Member
- 4685 posts
- Joined: 2月 2012
- Offline
Set the Group parameter of the Wrangle node to your group.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- wlvl
- Member
- 23 posts
- Joined: 7月 2015
- Offline
- Lukas Stolarski
- Member
- 35 posts
- Joined: 1月 2016
- Offline
Hi Sanostol!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).
would you mind put an example hip of the delete using vop method?
thanks in advance!
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
- caesar
- Member
- 143 posts
- Joined: 3月 2014
- Offline
- Thomas_FX
- Member
- 12 posts
- Joined: 2月 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
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
- Olaf Finkbeiner
- Member
- 323 posts
- Joined: 1月 2015
- Offline
- sepu
- Member
- 460 posts
- Joined: 2月 2012
- Online
- Thomas_FX
- Member
- 12 posts
- Joined: 2月 2018
- Offline
- tamte
- Member
- 8780 posts
- Joined: 7月 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
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
FX Supervisor
Method Studios, NY
- Arch
- Member
- 10 posts
- Joined: 11月 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”?
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 - 2018年5月16日 09:51:41
-
- Quick Links