Skip to content

Commit

Permalink
When inputting particles, also include the "age" attribute
Browse files Browse the repository at this point in the history
The "age" attribute needs to be explicitly included, because it's not
returned by the particle query command.
  • Loading branch information
andrewkww committed Sep 24, 2015
1 parent 0c410cc commit b35f1e2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion InputParticle.C
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,17 @@ InputParticle::setInputGeo(
MStringArray attributeNames;
MGlobal::executeCommand(getAttributesCommand, attributeNames);

// explicitly include some special per-particle attributes that
// aren't returned by the MEL command
switch(i)
{
case 0:
break;
case 1:
attributeNames.append("age");
break;
}

for(unsigned int j = 0; j < attributeNames.length(); j++)
{
const MString attributeName = attributeNames[j];
Expand All @@ -245,7 +256,8 @@ InputParticle::setInputGeo(

// mimics "listAttr -v -w" from AEokayAttr
MFnAttribute attributeFn(attributeObj);
if(!(!attributeFn.isHidden() && attributeFn.isWritable()))
if(!(!attributeFn.isHidden() && attributeFn.isWritable())
&& attributeName != "age")
{
continue;
}
Expand Down

0 comments on commit b35f1e2

Please sign in to comment.