Mimic Partition SOP in VEX

   2094   6   1
User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
Hi,
I would like to know how to mimic the Partition SOP in VEX, because it's currently not compilable.
I use it mainly like that, to put each point in his own group.

Thank you
Edited by RonanCroyal - Jan. 20, 2020 04:58:23

Attachments:
partition.png (26.2 KB)

User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
Hi you can do something like this in a Point Wrangle:

setpointgroup(0, sprintf("pt%s", @ptnum), @ptnum, 1);
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 | animatrix2k7.gumroad.com
User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
Fantastic, thanks a lot !
User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
Just an other one I need.
I also often use the Partition SOP to group from my “name” attribute, like in the screenshot.
How would you do that in VEX ?

Thanks !
Edited by RonanCroyal - Jan. 20, 2020 09:27:42

Attachments:
partitioname.png (27.0 KB)

User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
You can do it like this:

setprimgroup(0, s@name, @primnum, 1);
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 | animatrix2k7.gumroad.com
User Avatar
Member
8521 posts
Joined: July 2007
Online
maybe it's worth mentioning that using many groups can be very inefficient especially if there is no need for them
I can't imagine many scenarios when you'd need to partition geometry into groups instead of attributes (maybe just for export purposes for formats that rely on groups like obj, or for hengine hosts that require groups for various purposes)
so just keep that in mind
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
31 posts
Joined: Sept. 2018
Offline
animatrix_: Perfect, thank you !

tamte: Thanks for the heads up, I will definitively keep that in mind
  • Quick Links