VEX: create attribute from groups

   1431   2   1
User Avatar
Member
66 posts
Joined: 3月 2016
オフライン
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
Gerardo Castellanos
www.gerardocastellanos.com
User Avatar
Member
5125 posts
Joined: 2月 2012
オフライン
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 );
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
66 posts
Joined: 3月 2016
オフライン
Thanks!
Gerardo Castellanos
www.gerardocastellanos.com
  • Quick Links