//author : Walter Behrnes //title : simple back control //version : 1.0 //date last motified : couple of weeks ago from 6-11-2003 //instructions: //1 this script outputs an expression which you need to past in your expression editor //2 before running the script replace the given variable values with your object names. //3 after running the script copy the output expression ((found in your output window of the script editor)) into the expressin editor // *note this script goes under the assumption that you are using a spine that does not use // *auto orientation when turned on instead your spine uses the world orientation. // *also, you will need to create two cubes or curves for controllers on the spine. /////////////////////////////////////////////// //variables - EDIT TO YOUR NEEDS /////////////////////////////////////////////// //nodename == what we are ctrling minus any number following it //if your first joint is called Spn1 input "Spn" string $nodename = "Spn"; // StartJnt folowing number? //if your first joint is called Spn1 input 1 int $strtJnt = 1; //controller name == what controls the nodename? string $controllername = "BC"; string $Subcontrollername = "BC1"; //Switch to add in sub ctrl // at what joint do you want to start using the subctrl int $switcher = 4; //Joint limit == end joint //how many joints are in your chain? int $Jntlimit = 7; //xyz rotation //input the joints axis you want to control //if you want to control x and y you would input {"x","y"} string $xyz[] = {"x","y","z"}; int $count = size($xyz); /////////////////////////////////////////////// //Generates Code /////////////////////////////////////////////// print ("copy the following code into your expression editor\n\n"); print ("//Start of code\n"); for ($y = 0; $y < $count; $y++) { for ($i = $strtJnt; $i < ($Jntlimit+1); $i++) { if ($i <= $switcher) { print ("\n"+$nodename+""+$i+".r"+$xyz[$y]+" = "+$controllername+".r"+$xyz[$y]+" ;"); } if ($i > $switcher) { print ("\n"+$nodename+""+$i+".r"+$xyz[$y]+" = "+$controllername+".r"+$xyz[$y]+" + "+$Subcontrollername+".r"+$xyz[$y]+" ;"); } } } print ("\n\n//End of code");