// function to mark the output dirty once one of the dynamic attributes changes MStatus puttyNode::setDependentsDirty( const MPlug &plugBeingDirtied, MPlugArray &affectedPlugs ) { if ( plugBeingDirtied.isDynamic()) { MStatus status; MObject thisNode = thisMObject(); // there is a dynamic attribute that is is dirty, so mark // the outputGeometry dirty if ( MStatus::kSuccess == status ) { // cerr << "\n###" << plugBeingDirtied.name() <<" "<<output.name(); // MPlug pB( thisNode, puttyNode::outputGeom ); // affectedPlugs.append( pB ); MPlug pD( thisNode, puttyNode::aDynDirty ); pD.setValue(true); // affectedPlugs.append( output ); } } return( MS::kSuccess ); }
static void _GatherPrefixedAttrs( const std::map<std::string, std::string>& attrPrefixes, const std::map<std::string, std::string>& primvarPrefixes, const MDagPath &dag, std::vector<_AttributeEntry>* attrs) { MStatus status; MFnDependencyNode depFn(dag.node()); unsigned int numAttrs = depFn.attributeCount(); for (unsigned int i=0; i < numAttrs; ++i) { MObject attrObj = depFn.attribute(i); MPlug plg = depFn.findPlug(attrObj, true); if (plg.isNull()) { continue; } // Skip if not dynamic attr (user attribute) if (!plg.isDynamic()) { continue; } MString mayaPlgName = plg.partialName(false, false, false, false, false, true, &status); std::string plgName(mayaPlgName.asChar()); // Skip if it's an AbcExport-suffixed hint attribute. if (_EndsWithAbcTag(plgName)) { continue; } // Add entries based on attribute prefix list and primvar prefix list. _AddAttributeNameEntry(plgName, attrPrefixes, false, attrs); _AddAttributeNameEntry(plgName, primvarPrefixes, true, attrs); } }