hi i don't know whether u looked in maya documentation or not but i am
giving u some this might help
..but the code is in vc++ , u can easily convert it into python code..

u can override  setDependentsDirty of MPxNode

This method can be overridden in user defined nodes to specify which plugs
should be set dirty based upon an input plug * plugBeingDirtied* which Maya
is marking dirty. The list of plugs for Maya to mark dirty is returned by
the plug array * affectedPlugs*. This method handles both dynamic as well as
non-dynamic plugs and is useful in the following ways:


   - Allows attributeAffects-style relationships to be handled for
   dynamically-added attributes. Since *MPxNode::attributeAffects* can only
   be used with non-dynamic attributes, use of this method allows a way for all
   attributes of a node to affect one another, both dynamic and non-dynamic.

   - Provides more flexible relationships than what is available with *
   MPxNode::attributeAffects*. For example, you may wish to not dirty plugs
   when the current frame is one. However, as the routine is called during
   dirty propagation, there are restrictions on what can be done within the
   routine, most importantly you must not cause any dependency graph
   computation. For details, see the IMPORTANT NOTE below.

example:

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 );
    }

--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to