grouping by string attr (prims)
3724
3
0
deadalvs
Member
196 posts
Joined: 8月 2011
Offline
2017年12月26日 11:30
some times it's the little things ..
I have a geometry with many prims. each prim has an attr of the type string.
0 - A
1 - A
2 - B
3 - B
4 - A
Now I'd like to create a group called “A_group”, with all the according prims in it.
I can neither get the
attr wrangle code to work or do I understand the new
group expression node…
I'm sure it's super simple, but I'm lost and could not get this to work in 1.5 hours.
any input welcome!
m.
tamte
Member
8620 posts
Joined: 7月 2007
Offline
2017年12月26日 12:31
let's assume your attribute is called
name then you either append
- Partition SOP with rule set to:
OR
- Primitive Wrangle:
setprimgroup (0 , s@name +"_group" , @primnum , 1 );
Edited by tamte - 2017年12月26日 12:32:00
Tomas Slancik FX Supervisor Method Studios, NY
deadalvs
Member
196 posts
Joined: 8月 2011
Offline
2017年12月26日 13:28
thanks so much for this input! the approach with the Partition SOP does not work for me. Even with upper case characters. but the prim wrangle approach does work! so I have a solution that get the job done. thanks again!! m.
vusta
Member
555 posts
Joined: 2月 2017
Offline
2017年12月26日 15:33
for Partition, i do: rule: group_`@NAME` (if you need some ‘tip’, simply use one of the rule presets, say…Group by Color, then you'll see its syntax….then you'd be able to figure out the syntax)