Message 1 of 3
array compound attribute calling compute() on change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm writing a MPxParticleAttributeMapperNode to color particles arbitrarily and have an array compound attribute that controls the coloring parameters.
However, I can't seem to get the compute() method executing when I make a change to a child attribute with attributeAffects(). How can I ensure this executes each time a child in the array is changed?
e.g. the user changes colorMod[2].color (its an array compound attribute) and hence I would like compute() to be called.
MFnCompoundAttribute cmpAttr;
colorMod = cmpAttr.create("colorMod", "cm", &status);
cmpAttr.setArray(true);
cmpAttr.addChild(startParticle);
cmpAttr.addChild(endParticle);
cmpAttr.addChild(color);
cmpAttr.setReadable(true);
cmpAttr.setUsesArrayDataBuilder(true);
addAttribute(colorMod);
attributeAffects(startParticle, colorMod);
attributeAffects(endParticle, colorMod);
attributeAffects(color, colorMod);
attributeAffects( colorMod, outColorPP);