//bittnerRig_3 //copyright 2005 - 2006 by Thomas Bittner global proc br3_updateField(string $ctrol, string $objecttype) { string $sel[] = `ls -sl -showType -dag`; if (($sel[1] == $objecttype) || ($sel[3] == $objecttype)) textFieldButtonGrp -e -text $sel[0] $ctrol; else warning ("please select a " + $objecttype); } proc rebuildJointsRepeatProc(string $joint) { string $oldjoint; $prefix = "_new"; float $jointpos[2] = `xform -q -ws -t $joint`; string $eltern[] = `listRelatives -p $joint`; if (size($eltern[0]) && `objExists ($eltern[0] + $prefix)`) { select ($eltern[0] + $prefix); $oldjoint = $eltern[0] + $prefix; } else select -cl; string $newjoint = `joint -n ($joint + $prefix) -p $jointpos[0] $jointpos[1] $jointpos[2]`; if ($eltern[0] != "" && `objExists ($eltern[0] + $prefix)` ) joint -e -zso -oj xyz -sao yup $oldjoint; string $children[] = `listRelatives -c $joint`; for ($i = 0;$i>; return mag($thevector); } proc makectroll(string $name, string $type, float $width, float $length, float $height) { global float $br3_size; if (`checkBox -q -v br3_cb_buildingprocess`) refresh; switch ($type) { case "cube": string $thecurve = `curve -d 1 -p -0.5 0.5 -0.5 -p 0.5 0.5 -0.5 -p 0.5 0.5 0.5 -p -0.5 0.5 0.5 -p -0.5 0.5 -0.5 -p -0.5 -0.5 -0.5 -p 0.5 -0.5 -0.5 -p 0.5 0.5 -0.5 -p 0.5 -0.5 -0.5 -p 0.5 -0.5 0.5 -p 0.5 0.5 0.5 -p 0.5 -0.5 0.5 -p -0.5 -0.5 0.5 -p -0.5 0.5 0.5 -p -0.5 -0.5 0.5 -p -0.5 -0.5 -0.5 -p -0.5 0.5 -0.5 -p -0.5 -0.5 -0.5 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17` ; break; case "sphere": string $thecurve = `curve -d 1 -p 0 1 0 -p -0.433013 0.5 0.75 -p -0.433013 -0.5 0.75 -p 0 -1 0 -p 0.866025 -0.5 0 -p 0.866025 0.5 0 -p 0 1 0 -p -0.433013 0.5 -0.75 -p -0.433013 -0.5 -0.75 -p 0 -1 0 -p 0.866025 -0.5 0 -p -0.433013 -0.5 0.75 -p -0.433013 -0.5 -0.75 -p 0.866025 -0.5 0 -p 0.866025 0.5 0 -p -0.433013 0.5 0.75 -p -0.433013 0.5 -0.75 -p 0.866025 0.5 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 `; break; case "circle": string $col[] = `circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1`; string $thecurve = $col[0]; setAttr ($thecurve + ".rotateZ") 90; break; case "square": string $thecurve = `curve -d 1 -p -0.5 0.5 0 -p 0.5 0.5 0 -p 0.5 -0.5 0 -p -0.5 -0.5 0 -p -0.5 0.5 0 -k 0 -k 1 -k 2 -k 3 -k 4`; setAttr ($thecurve + ".rx") 90; break; case "cylinder": string $thecurve = `curve -d 1 -p 0.5 0.154508 0.475528 -p 0.5 0.5 0 -p -0.5 0.5 0 -p 0.5 0.5 0 -p 0.5 0.154509 -0.475528 -p -0.5 0.154509 -0.475528 -p 0.5 0.154509 -0.475528 -p 0.5 -0.404509 -0.293893 -p -0.5 -0.404509 -0.293893 -p 0.5 -0.404509 -0.293893 -p 0.5 -0.404509 0.293893 -p -0.5 -0.404509 0.293893 -p 0.5 -0.404509 0.293893 -p 0.5 0.154508 0.475528 -p -0.5 0.154508 0.475528 -p -0.5 0.5 0 -p -0.5 0.154509 -0.475528 -p -0.5 -0.404509 -0.293893 -p -0.5 -0.404509 0.293893 -p -0.5 0.154508 0.475528 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 -k 17 -k 18 -k 19` ; break; case "kreuz": string $thecurve = `curve -d 1 -p -0.333 0.999 0 -p 0.333 0.999 0 -p 0.333 0.333 0 -p 0.999 0.333 0 -p 0.999 -0.333 0 -p 0.333 -0.333 0 -p 0.333 -0.999 0 -p -0.333 -0.999 0 -p -0.333 -0.333 0 -p -0.999 -0.333 0 -p -0.999 0.333 0 -p -0.333 0.333 0 -p -0.333 0.999 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12` ; break; } DeleteHistory; setAttr ($thecurve + ".scaleX") ($width * $br3_size); setAttr ($thecurve + ".scaleY") ($height * $br3_size); setAttr ($thecurve + ".scaleZ") ($length * $br3_size); makeIdentity -apply true -t 0 -r 1 -s 1 -n 0; rename $thecurve $name; } proc mirrorLocs(string $locators[]) { for ($i = 0;$i 0) setAttr ($scalefactor + ".input2X") `getAttr($endjoint + ".tx")`; else setAttr ($scalefactor + ".input2X") (`getAttr($endjoint + ".tx")` * -1); connectAttr ($endjoint + ".tx") ($scalefactor + ".input1X"); setAttr ($scalefactor + ".operation") 2; string $jointscaler = `shadingNode -asUtility multiplyDivide -n ($startjoint + "_inbetweenscaleeachjoint")`; setAttr ($jointscaler + ".input1X") `getAttr($finaljoints[1] + ".tx")`; connectAttr ($scalefactor + ".outputX") ($jointscaler + ".input2X"); for ($i = 1;$i 3) for ($i = 3;$i 3) for ($i = 3;$i