//blendShapeAnimator V 1.0 //author: volk@renderwahnsinn.de //info: This tool creates blendShapes from selected objects to increase // processing time! Idea by Florian Kraft (http://www.flokraft.de/), // hacked by me :-) //usage: select Objects and run blendShapeAnimator global proc blendShapeAnimator(int $startTime, int $endTime) { string $selection[] = `ls -sl`; string $object = $selection[0]; string $blendShapes[]; int $i; for ($i=$startTime; $i<=$endTime; $i++) { currentTime $i; string $temp[] = `duplicate -rr $object`; $blendShapes[$i] = $temp[0]; } delete -ch $object; string $command = "blendShape "; for ($i=$startTime; $i<=$endTime; $i++) { $command = $command + $blendShapes[$i] + " "; } $command = $command + $object; string $temp[] = `eval($command)`; string $blendShapeName = $temp[0]; for ($i=$startTime; $i<=$endTime; $i++) { currentTime $i; setAttr ($blendShapeName + "." + $blendShapes[$i]) 1; if ($i>$startTime) setAttr ($blendShapeName + "." + $blendShapes[$i-1]) 0; setKeyframe -ott "step" ($blendShapeName + ".w"); } select -cl; for ($i=$startTime; $i<=$endTime; $i++) { select -add $blendShapes[$i]; } group -n ("blendShapes_" + $object); }