VEX: create attribute from groups
671
2
1
Hello everybody
I want to create as many attributes (float) as groups I have, and that have the same name of the group, procedurally.
something like this:
string groups[] = detailintrinsic(0, 'primitivegroups');
foreach (string g; groups) {
if (inprimgroup(0,g,@primnum)==1) {
f@`g` = 1.0;
}
}
but it does not work.
Thanks in advance
-
- animatrix_
- Member
- 4515 posts
- Joined: 2月 2012
- Offline
Hi,
You can do it like this using a Primitive Wrangle:
string groups [ ] = detailintrinsic ( 0, "primitivegroups" );
foreach ( string group; groups )
if ( inprimgroup ( 0, group, @primnum ) )
setprimattrib ( 0, group, @primnum, 1.0 );