// =========================================================================== // 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. // =========================================================================== global proc ik2Bsolver() // // Description: // This mel procedure creates an IK 2 Bone Solver Node. // Additionally, it sets up the callbacks for the solver to // appear to remain persistent across File->New, // and File->Open operations. After a File->New // or File->Open, the callbacks recreate the // IK 2 Bone Solver Node. // // Note that the ik2Bsolver must be loaded before this procedure is called. // { // Check to see if the plug-in is loaded // if( !`pluginInfo -q -l "ik2Bsolver"` ) { loadPlugin "ik2Bsolver"; } // Now create the node and register the callbacks // if( !`objExists ik2Bsolver` ) { // Turn off undo // undoInfo -swf false; // We do not wish to disrupt the selection list, so // record the active list and restore it after node creation. // string $sel[] = `ls -sl`; eval( "createNode -s -n ik2Bsolver ik2Bsolver" ); eval( "addIK2BsolverCallbacks" ); select -r $sel; // Restore undo // undoInfo -swf true; } // Finally inform solver related UI that the list of // available solvers has been modified. // ikUpdateSolverUI; }