// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // // // // // Creation Date: August 10/2000 // ////////////////////////////////////////////////////////////////////// // // Procedure Name: // connectNodeToNodeOverride // // Description: // This procedure is provided as a hook for customers to allow // you to redefine the behaviour of drag and drop. // // Input Arguments: // $srcNode - the name of the source node (the dragged node) // $dstNode - the name of the destination node (the dropped-on node) // // Return Value: // Return 1 if you want Maya continue and perform the operation // that would normally result from this connection. // Return 0 if you have chosen to implement a different behaviour // for this connection and don't want the normal operation to // be performed as well. // global proc int connectNodeToNodeOverride( string $srcNode, string $dstNode) { // print( // "connectNodeToNodeOverride(" // + $srcNode // + ", " // + $dstNode // + ") called\n"); // By default the return value of this procedure is 1, so that Maya // will perform the normal operation for a connection between these // two nodes. // int $rDoNormalOperation = 1; // // If you wish to change the behaviour of drag and drop of a node onto // another node in Maya use the callback 'connectNodeToNodeOverrideCallback'. // // Typically this procedure would get called when a node is dragged onto a // node in the multilister, hypershade or hypergraph (when not in DAG // view). // int $thirdPartyDoNormalOperationRequests[] = `callbacks -executeCallbacks -hook "connectNodeToNodeOverrideCallback" $srcNode $dstNode`; for ($thirdPartyDoNormalOperationRequest in $thirdPartyDoNormalOperationRequests) { if($thirdPartyDoNormalOperationRequest == 0) { $rDoNormalOperation = 0; break; } } return $rDoNormalOperation; }