Python API 2.0 Reference
OpenMayaUI.MPxDragAndDropBehavior Class Reference
+ Inheritance diagram for OpenMayaUI.MPxDragAndDropBehavior:

Public Member Functions

def __init__ ()
 
def connectAttrToAttr ()
 
def connectAttrToNode ()
 
def connectNodeToAttr ()
 
def connectNodeToNode ()
 
def shouldBeUsedFor ()
 

Static Public Member Functions

def __new__ ()
 

Detailed Description

This is the base class for user defined drag and drop behaviors.

Constructor & Destructor Documentation

def OpenMayaUI.MPxDragAndDropBehavior.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMayaUI.MPxDragAndDropBehavior.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
def OpenMayaUI.MPxDragAndDropBehavior.connectAttrToAttr ( )
connectAttrToAttr(sourcePlug, destinationPlug, force) -> None

This method is called by the defaultNavigation command to connect a source attribute to a destination attribute.

If this method is overidden it should attempt to determine what the user probably wants this connection to be, and set up the connection appropriately. If the force argument is true it is intended to notify the user to break any existing connections to the plug, similar to what the mel command 'connectAttr' -f flag is used for.

* sourcePlug (MPlug) - Source plug in the connection.
* destinationPlug (MPlug) - Destination plug in the connection.
* force (bool) - Tells whether or not to break any existing connections to the destination attribute.
def OpenMayaUI.MPxDragAndDropBehavior.connectAttrToNode ( )
connectAttrToNode(sourcePlug, destinationNode, force) -> None

This method is called by the defaultNavigation command to connect a source attribute to a destination node.

You should override this method if you can determine from the type of source node and attribute and the type of destination node what the user is trying to do and you know the appropriate connections that must be made for the end result to be what the user expects.

* sourcePlug (MPlug) - Source plug in the connection.
* destinationNode (MObject) - Destination node for the connection.
* force (bool) - Tells whether or not to break any existing connections to the destination node.
def OpenMayaUI.MPxDragAndDropBehavior.connectNodeToAttr ( )
connectNodeToAttr(sourceNode, destinationPlug, force) -> None

This method is called by the defaultNavigation command to connect a source node to a destination attribute.

You should override this method if you can determine from the type of source node and the type of destination node and attribute what the user is trying to do and you know the appropriate connections that must be made for the end result to be what the user expects.

* sourceNode (MObject) - Source node in the connection.
* destinationPlug (MPlug) - Destination plug for the connection.
* force (bool) - Tells whether or not to break any existing connections to the destination attribute.
def OpenMayaUI.MPxDragAndDropBehavior.connectNodeToNode ( )
connectNodeToNode(sourceNode, destinationNode, force) -> None

This method is called by the defaultNavigation command to connect a source node to a destination node.

You should override this method if you can determine from the type of source node and the type of destination node what the user is trying to do and you know the appropriate connections that must be made for the end result to be what the user expects.

* sourceNode (MObject) - Source node in the connection.
* destinationNode (MObject) - Destination node for the connection.
* force (bool) - Tells whether or not to break any existing connections to the destination node.
def OpenMayaUI.MPxDragAndDropBehavior.shouldBeUsedFor ( )
shouldBeUsedFor(sourceNode, destinationNode, sourcePlug, destinationPlug) -> bool

This method must be overridden in order to use a drag and drop behavior.

The overridden method will be called by the defaultNavigation command to determine wether or not to use this drag and drop behavior to finish a connection. If the user would like to handle the connection between sourceNode/Plug and destinationNode/Plug then this routine must pass back true, otherwise the routine must pass back false in order for the default connection mechanism to work between these two nodes. sourcePlug and destinationPlug may be null depending on if there were any attributes given in the drag and drop. Use the isNull() method on MPlug to assure the plugs are valid.

* sourceNode (MObject) - The source node of the drag and drop or the node being dragged.
* destinationNode (MObject) - the destination node of the drag and drop or the node being dropped upon.
* sourcePlug (MPlug) - The source plug of the drag and drop or the plug being dragged (this may be null).
* destinationPlug (MPlug) - The destination plug of the drag and drop or the plug being dropped upon (this may be null).