// =========================================================================== // 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: // connectNodeToAttrOverride // // 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 (the dragged node) // $dstNodeAndAttr - the name of the destination (the dropped-on attr) // // 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 connectNodeToAttrOverride( string $srcNode, // ie) checker2 string $dstNodeAndAttr) // ie) lambert1.normalCamera { // print( // "connectNodeToAttrOverride(" // + $srcNode // + ", " // + $dstNodeAndAttr // + ") 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 an attribute in Maya, you should implement the behaviour you // wish here. // // Typically this procedure would get called when a node is dragged onto an // attribute in the attribute editor in Maya or when a node is dragged onto // an object in the 3d view. // // This is one likely procedure that you would want to implement to // change Maya's drag and drop behaviour. For example, if you were a game // developer and you wanted to allow an artist to drag and drop a texture // onto an object in the 3d view with meaningful consequences, you would // implement this method to recognize that action and assign shading // groups/create shading networks/etc as appropriate. // // connect mental ray shader to mental ray render globlas "contour store" and "contour contrast" if( $dstNodeAndAttr == "miDefaultOptions.contourStore" || $dstNodeAndAttr == "miDefaultOptions.contourContrast" ) { connectAttr -f ($srcNode + ".message" ) $dstNodeAndAttr; return 0; } return $rDoNormalOperation; }