Wednesday, February 19, 2014

quickControl.mel

again with the facebook requests!

in any case, super quick script for creating control curves based on selected objects and parenting the objects under them





// stephenkmann@gmail.com
// creates a nurbs curve with a parent, and parents the selected objects under it alla  a quick control //curve for animation.
global proc quickControl ()
{
string $sel[] = `ls -sl`;
for ($each in $sel)
    {
    float $pos[] = `xform -q -ws -rp $each` ;
    float $rot[] = `xform -q -ws -ro $each`;
    select -cl;
    string $grp = `group -em -n ($each + "CONGR")`;

    string $control =` curve -n ($each + "CONTROL") -d 1 -p -4 0 -4 -p 4 0 -4 -p 4 0 4 -p -4 0 4 -p -4 0 -4 -p 0 0 -4 -p 3.134446 0 -3.134446 -p 4 0 0 -p 3.134446 0 3.134446 -p 0 0 4 -p -3.134446 0 3.134446 -p -4 0 0 -p -3.134446 0 -3.134446 -p 0 0 -4 -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 `;
    parent $control $grp;

move -rpr -xyz $pos[0] $pos[1] $pos[2]  $grp;
xform -ws -ro $rot[0] $rot[1] $rot[2]  $grp;

parent $each $control;

    }
}

No comments:

Post a Comment