How do you create groups in an attribute VOP?

   14865   9   3
User Avatar
Member
32 posts
Joined: Dec. 2014
Offline
Hi Guys,

I tried searching this one and had no luck. For the life of me I cannot figure out how to create groups of points etc. in the attribute VOP. Would like to know how, then I'd able to replicate what you'd do out in SOPS with the standard group node (but in VOPS)

Thanks - any help would be awesome!
Kind Regards,

Ben
User Avatar
Member
1743 posts
Joined: March 2012
Offline
I don't know how to use the Attribute VOP SOP on its own very well, but in Attribute Wrangle, you can just do something like:

@group_myAwesomeGroup = 1;

My guess is that you need to set up a binding for a group to a variable and set that variable, but I don't know how to do that with a raw Attribute VOP SOP.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
32 posts
Joined: Dec. 2014
Offline
Thanks dude, gives me something to work with
Kind Regards,

Ben
User Avatar
Staff
6169 posts
Joined: July 2005
Offline
You could always make a Bind Export and name the export group_myAweseomeGroup.

Alternatively, on the Attribute Bindings Tab you can add an explicit group binding.

Group name: myAwesomeGroup
VEX Parameter: foo

Then do a Bind Export to foo and it will write to myAwesomeGroup. Attribute bindings are the best way to go if you want to dynamically create the group name, like with a chs() expression.

Finally, you can do a Set Attribute VOP with the Attribute Class set to Point Group. This is bests if you want to set a different type of group than you are iterating over, or if you want to set the group membership of points other than the current point.
User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
Hi Jeff,

What's the equivalent of @group_myAwesomeGroup = 1; for dynamic groups using chs in VEX?

addgroup and newgroup is non-CVEX and setpointgroup is meant to be used to set points in a group other than the current point, right?

Should we use backticks in VEX code?



Cheers.
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
Staff
6169 posts
Joined: July 2005
Offline
Attribute Wrangle also has bindings.

@foo = 1;

and then set the binding of myAwesomeGroup to foo.
User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
Thanks Jeff, I didn't think of that. Now it's complete
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
Staff
6169 posts
Joined: July 2005
Offline
It seems I was wrong…. Sadly, groups are integer, so @foo = 1 will fail to bind to the group, forcing you to do i@foo = 1.

Bug: 67283 is now present to reflect the fact we should allow float vex variables to bind to groups.
User Avatar
Member
47 posts
Joined: Jan. 2014
Offline
The Set Attribute VOP has controls for adding points or primitives to groups.
User Avatar
Member
4495 posts
Joined: Feb. 2012
Offline
jlait
It seems I was wrong…. Sadly, groups are integer, so @foo = 1 will fail to bind to the group, forcing you to do i@foo = 1.

Bug: 67283 is now present to reflect the fact we should allow float vex variables to bind to groups.

Thanks Jeff, looking forward to it
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
  • Quick Links