/* '' '' Script Name: WeightExercise Setup v0.1 '' Author: Alex V. U. Strarup (3d@strarup.net) '' Created: 4. Nov. 2003 '' Last Updated: 18. March 2004 */ //////////////////////////////////////////////////////////////////////////////////////////// // // this script was made to setup a weight exercise, during a 3D Animation Course at the // AnimationWorkshop Viborg Denmark... // //////////////////////////////////////////////////////////////////////////////////////////// // // DESCRIPTION : setup script for creating a box constrain for a weight exercise... // //////////////////////////////////////////////////////////////////////////////////////////// // //put the script in the script folder C:\Documents and Settings\~Your_User_Name~\Documents\maya\5.0\scripts // // change LEFT_IK_HANDLE_NAME to the Name of your Left Hand Ik Controller... // and change Right_IK_HANDLE_NAME to the Name of your Right Hand Ik Controller... // // if you are using Maya 4.5 you would also have to change the parentConstraint, // to a pointConstraint and a orientConstraint... e.g. --> // delete `pointConstraint DaBox BoxLocator`; // delete `orientConstraint DaBox BoxLocator`; //////////////////////////////////////////////////////////////////////////////////////////// // //How to call the script, just write... // WeightExerciseSetup; in the commandline // //////////////////////////////////////////////////////////////////////////////////////////// // // Conditions : USE AT YOUR OWN RISK, NO RESPONSABILITIES DUE TO MALFUNCTION, JOB LOST, WHATEVER. // //////////////////////////////////////////////////////////////////////////////////////////// global proc WeightExerciseSetup() { //create the box... polyCube -w 5 -h 5 -d 5 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -tx 1 -ch 1 -n "DaBox"; //move it... setAttr "DaBox.ty" 2.5; setAttr "DaBox.tz" 7; //freeze the transformation... performFreezeTransformations 2; makeIdentity -apply true -t 1 -r 1 -s 1; //move the pivotpoint of the box move 0 0 4.5 DaBox.scalePivot DaBox.rotatePivot ; //create the Boxlocator which shall drive the hands... spaceLocator -p 0 0 0 -n "BoxLocator"; //contrain it to the box, and delete the constrain... delete `parentConstraint DaBox BoxLocator`; //constrain the box to the locator...... parentConstraint BoxLocator DaBox; //make the boxlocator a bit bigger so it is easier to select and freeze translation... scale -r 2 2 2 BoxLocator; performFreezeTransformations 2; makeIdentity -apply true -t 1 -r 0 -s 0; //create the lefthand locator... spaceLocator -p 0 0 0 -n "LH_Locator"; //contrain it to the left ikController, and delete the constrain... //change LEFT_IK_HANDLE_NAME to the Name of your Left Hand Ik Controller... delete `parentConstraint LEFT_IK_HANDLE_NAME LH_Locator`; //constrain the left ikController to the locator... parentConstraint LH_Locator LEFT_IK_HANDLE_NAME; //create the righthand locator... spaceLocator -p 0 0 0 -n "RH_Locator"; //contrain it to the left ikController, and delete the constrain... //change Right_IK_HANDLE_NAME to the Name of your Right Hand Ik Controller... delete `parentConstraint RIGHT_IK_HANDLE_NAME RH_Locator`; //constrain the Right ikController to the locator...... parentConstraint RH_Locator RIGHT_IK_HANDLE_NAME; //parent the handlocators to the box locator parent LH_Locator RH_Locator BoxLocator ; }
//lock the "move" attributes of the ikControllers... select -r LEFT_IK_HANDLE_NAME.tx LEFT_IK_HANDLE_NAME.ty LEFT_IK_HANDLE_NAME.tz LEFT_IK_HANDLE_NAME.rx LEFT_IK_HANDLE_NAME.ry LEFT_IK_HANDLE_NAME.rz RIGHT_IK_HANDLE_NAME.tx RIGHT_IK_HANDLE_NAME.ty RIGHT_IK_HANDLE_NAME.tz RIGHT_IK_HANDLE_NAME.rx RIGHT_IK_HANDLE_NAME.ry RIGHT_IK_HANDLE_NAME.rz; setAttr -lock true `ls -sl`; select -cl;
//Get the Box Locator... select -r BoxLocator; //Get the Left Hand Locator... select -r LH_Locator; //Get the Right Hand Locator... select -r RH_Locator;