grouping by string attr (prims)
4857
3
1
deadalvs
Member
196 posts
Joined: Aug. 2011
Offline
Dec. 26, 2017 11:30 a.m.
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
9380 posts
Joined: July 2007
Offline
Dec. 26, 2017 12:31 p.m.
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 - Dec. 26, 2017 12:32:00
Tomas Slancik CG Supervisor Framestore, NY
deadalvs
Member
196 posts
Joined: Aug. 2011
Offline
Dec. 26, 2017 1:28 p.m.
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: Feb. 2017
Offline
Dec. 26, 2017 3:33 p.m.
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)