#include <MPxDragAndDropBehavior.h>
Drag and Drop Behavior.
This is the base class for user defined drag and drop behaviors. This class allows a plugin to override the behavior of drag and drop connections from nodes in the hyperGraph/hyperShade to other nodes or other UI. These behaviors are defined by the type of relationship that is trying to be resolved. These are connectAttrToAttr(), connectAttrToNode(), connectNodeToAttr(), connectNodeToNode(). In order for the overridden methods to be executed the shouldBeUsedFor() method must be overridden in order to decide which behavior to use given the source and destination node.
Public Member Functions | |
MPxDragAndDropBehavior () | |
Class constructor. | |
virtual | ~MPxDragAndDropBehavior () |
Class destructor. | |
MPxDragAndDropBehavior (void *init) | |
This method is obsolete. More... | |
virtual bool | shouldBeUsedFor (MObject &sourceNode, MObject &destinationNode, MPlug &sourcePlug, MPlug &destinationPlug) |
This method must be overridden in order to use a drag and drop behavior. More... | |
virtual MStatus | connectAttrToAttr (MPlug &sourcePlug, MPlug &destinationPlug, bool force) |
This method is called by the defaultNavigation command to connect a source attribute to a destination attribute. More... | |
virtual MStatus | connectAttrToNode (MPlug &sourcePlug, MObject &destinationNode, bool force) |
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. More... | |
virtual MStatus | connectNodeToAttr (MObject &sourceNode, MPlug &destinationPlug, bool force) |
This method is called by the defaultNavigation command to connect a source node to a destination attribute. More... | |
virtual MStatus | connectNodeToNode (MObject &sourceNode, MObject &destinationNode, bool force) |
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. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
MPxDragAndDropBehavior | ( | void * | init | ) |
This method is obsolete.
[in] | init |
|
virtual |
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.
[in] | sourceNode | The source node of the drag and drop or the node being dragged |
[in] | destinationNode | the destination node of the drag and drop or the node being dropped upon |
[in] | sourcePlug | The source plug of the drag and drop or the plug being dragged (this may be null) |
[in] | destinationPlug | The destination plug of the drag and drop or the plug being dropped upon (this may be null) |
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.
[in] | sourcePlug | Source plug in the connection |
[in] | destinationPlug | Destination plug in the connection |
[in] | force | Tells whether or not to break any existing connections to the destination attribute |
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.
[in] | sourcePlug | Source plug for the connection |
[in] | destinationNode | Destination node for the connection |
[in] | force | Tells whether or not to break any existing connections to the destination node |
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.
[in] | sourceNode | Source node for the connection |
[in] | destinationPlug | Destination plug for the connection |
[in] | force | Tells whether or not to break any existing connections to the destination attribute |
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.
[in] | sourceNode | Source node for the connection |
[in] | destinationNode | Destination node for the connection |
[in] | force | Tells whether or not to break any existing connections to the destination node |
|
static |
Returns the name of this class.