Form and Space

creating CG 3D since 2001

  • Connect @
  • Linked in
  • Vimeo
  • Twitter

Maya: Neutral Pose

Matthew | April 25, 2012

No Comments

Use this script to create a neutral pose, sort of. For example, say you had a model robot, and you have already set the pivot point for each part. This will take the pivot, and create a group at the pivot location. The group is translation 0,0,0 rotation 0,0,0 and scale 1,1,1. Effectively, a neutral pose.

mls_neutralPose();

proc mls_neutralPose()
{
string $oSelection[] = `ls -sl`;
int $oCount = size($oSelection); 

for ($i = 0; $i < $oCount; $i++){
    select -r $oSelection[$i];  

    //get the pivot location of the selection
    vector $v1 = `xform -q -t`;
    vector $v2 = `xform -q -sp`;
    vector $v3 = $v1 + $v2;
    
    print ($v3);
    //make a group and move it to the pivot location
    group; 
    xform -os -piv ($v3.x) ($v3.y) ($v3.z);
}
}

Leave a Reply

Twitter

Subscribers

    396