MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Houdini/comments/1y2lyd1/create_groups_based_on_the_attribute_value_in_vex/
r/Houdini • u/Cautious_Ad1551 • 5d ago
Hi, I want to group these prims by the name value. I got it to work with group nodes but I want to do it with vex( photo below). How to do this?
5 comments sorted by
6
In a primitive wrangle
string group_name = sprintf("id_%d", i@name); setprimgroup(0, group_name, @primnum, 1, "set");
2 u/DavidTorno Houdini Educator & Tutor - FendraFx.com 5d ago Using adhoc expressions in groups is far more efficient as legomir commented. Houdini is highly optimized for attributes.Your task here can be done with the Groups From Names SOP, but as it states in the docs, it a bad idea to do so.lithium’s comment would definitely be the VEX code equivalent, but again making a bunch of unique groups is highly advised against in production work.
2
Using adhoc expressions in groups is far more efficient as legomir commented. Houdini is highly optimized for attributes.
Your task here can be done with the Groups From Names SOP, but as it states in the docs, it a bad idea to do so.
lithium’s comment would definitely be the VEX code equivalent, but again making a bunch of unique groups is highly advised against in production work.
5
Groups by Name SOP
3
Why do you need groups? This can be done in most cases with adhoc group expression like: @id==2. In case when you really need to create names groups:- detail wrangle- use this to find uniqueval count: https://www.sidefx.com/docs/houdini/vex/functions/nuniqueval.html- get value with: https://www.sidefx.com/docs/houdini/vex/functions/uniqueval.html- use: https://www.sidefx.com/docs/houdini/vex/functions/sprintf.html for grp name- use: https://www.sidefx.com/docs/houdini/vex/functions/setpointgroup.html to set group
Edit:Ye oldie cluster sop may help too.
1
It's off topic but I haven't moved to H22 but is there a way to turn off the parmsheet icons ??? they look rly unsightly.
6
u/lithium 5d ago
In a primitive wrangle
5
u/GuIlHeM55 5d ago
Groups by Name SOP
3
u/legomir FX pipe TD 5d ago
Why do you need groups? This can be done in most cases with adhoc group expression like: @id==2. In case when you really need to create names groups:
- detail wrangle
- use this to find uniqueval count: https://www.sidefx.com/docs/houdini/vex/functions/nuniqueval.html
- get value with: https://www.sidefx.com/docs/houdini/vex/functions/uniqueval.html
- use: https://www.sidefx.com/docs/houdini/vex/functions/sprintf.html for grp name
- use: https://www.sidefx.com/docs/houdini/vex/functions/setpointgroup.html to set group
Edit:
Ye oldie cluster sop may help too.
1
u/schmon 3d ago
It's off topic but I haven't moved to H22 but is there a way to turn off the parmsheet icons ??? they look rly unsightly.