![]() | Type |
![]() | MPxNode () |
![]() | ~MPxNode () |
![]() | postConstructor () |
![]() | compute ( const MPlug & plug, MDataBlock & dataBlock ) |
![]() | getInternalValueInContext ( const MPlug & plug, MDataHandle & dataHandle, MDGContext & ctx) |
![]() | setInternalValueInContext ( const MPlug & plug, const MDataHandle & dataHandle, MDGContext & ctx) |
![]() | getInternalValue ( const MPlug & plug, MDataHandle & dataHandle) |
![]() | setInternalValue ( const MPlug & plug, const MDataHandle & dataHandle) |
![]() | internalArrayCount ( const MPlug & plug, const MDGContext & ctx) const |
![]() | copyInternalData ( MPxNode * ) |
![]() | legalConnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const |
![]() | legalDisconnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const |
![]() | setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray) |
![]() | connectionMade ( const MPlug & plug, const MPlug & otherPlug, bool asSrc ) |
![]() | connectionBroken ( const MPlug & plug, const MPlug & otherPlug, bool asSrc ) |
![]() | isPassiveOutput ( const MPlug & plug ) const |
![]() | shouldSave ( const MPlug & plug, bool& isSaving ) |
![]() | passThroughToOne ( const MPlug & plug ) const |
![]() | passThroughToMany ( const MPlug & plug, MPlugArray & plugArray ) const |
![]() | typeId () const |
![]() | typeName () const |
![]() | name () const |
![]() | type () const |
![]() | isAbstractClass () const |
![]() | thisMObject () const |
![]() | addAttribute ( const MObject & attr ) |
![]() | inheritAttributesFrom ( const MString & parentClassName ) |
![]() | attributeAffects ( const MObject & whenChanges, const MObject & isAffected ) |
![]() | setExistWithoutInConnections ( bool flag ) |
![]() | existWithoutInConnections ( MStatus * ReturnStatus = NULL ) const |
![]() | setExistWithoutOutConnections ( bool flag ) |
![]() | existWithoutOutConnections ( MStatus * ReturnStatus = NULL ) const |
![]() | message message attribute |
![]() | isHistoricallyInteresting is historically interesting attribute |
![]() | caching caching attribute |
![]() | state state attribute |
![]() | forceCache ( MDGContext & ctx= MDGContext::fsNormal ) USE _forceCache() IN SCRIPT |
![]() | setMPSafe ( bool flag ) USE _setMPSafe() IN SCRIPT |
![]() | setDoNotWrite ( bool flag ) |
![]() | doNotWrite ( MStatus *ReturnStatus = NULL ) const |
const MString exampleNode::A( "A" ); // Dynamic attribute "A" MObject exampleNode::attrB; // Non-dynamic attribute "B" MStatus exampleNode::setDependentsDirty( const MPlug &plugBeingDirtied, MPlugArray &affectedPlugs ) { // This example shows a dynamic attribute (A) affecting a // non-dynamic attribute (B). For an example of a dynamic // affecting a dynamic, please the the developer's toolkit // example plug-in, affectsNode.cpp. // if ( plugBeingDirtied.partialName() == A ) { // "A" is being dirtied. We want "A" to affect "B", so we // add "B" to the list of plugs for Maya to dirty. Once again, // please see the IMPORTANT NOTE about what you can and // cannot do within a setDependentsDirty() routine. // MObject thisNode = thisMObject(); MPlug pB( thisNode, exampleNode::attrB ); affectedPlugs.append( pB ); } return( MS::kSuccess ); }In the above example, whenever plugBeingDirtied is A, we add B to affectedPlugs so that Maya will dirty B and also any plugs which depend upon B. For cases where multi compound attributes are dirtied, it is the programmer's responsibility to define ALL affects relationships. Dirtying the parent plug of a multi does not imply that all of its children will be marked dirty. Likewise, dirtying a child attribute does not imply the parent of the multi is dirty. This must be explicitly defined using the affected plug array. The following example demonstrates how one would dirty both the element affected and the parent plug.
MObject exampleNode::inputAttr; // Non-dynamic multi-input attribute. MObject exampleNode::outputAttr; // Non-dynamic multi-output attribute. MStatus exampleNode::setDependentsDirty(MPlug const & inPlug, MPlugArray & affectedPlugs) { if ( inPlug.attribute() != inputAttr ) { return MS::kSuccess; } MPlug outArrayPlug(thisMObject(),outputAttr); if (inPlug.isElement()) { // First dirty the output output element first. // Of course, dirty output element itself MPlug elemPlug = outArrayPlug.elementByLogicalIndex( inPlug.logicalIndex()); affectedPlugs.append(elemPlug); // We also need to dirty the parent. // affectedPlugs.append(outArrayPlug); } else { // Mark the parent output plug as dirty. // affectedPlugs.append(outArrayPlug); // Also visit each element. // unsigned int i,n = outArrayPlug.numElements(); for (i = 0; i < n; i++) { MPlug elemPlug = outArrayPlug.elementByPhysicalIndex(i); affectedPlugs.append(elemPlug); } } return MS::kSuccess; }IMPORTANT NOTE: since the setDependentsDirty() method is called during dirty propagation, you must be careful not to perform any dependency graph computations from within the routine. Instead, if you want to know the value of a plug, use MDataBlock::outputValue() because it will not result in computation (and thus recursion). In general, the majority of setDependentsDirty() methods which users will implement should involve only fixed relationships. In the rare occurence where you need to look at plug values, please heed the warning with MDataBlock::outputValue() and use plugs which contain values which you know to be up to date prior to the start of dirty propagation. Arguments
Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. | doc++ Copyright |