[Maya]Quick align in Maya
Posted: Tue Sep 02, 2008 9:49 am
Quick align in Maya
Usage: Select the the object you wish to move, then shift-select the object you want it to get aligned to (it aligns to its pivot).
You can select the script text in the Script Editor and drag it to a shelf spot to create a shortcut for it. Select MEL when prompted for MEL/Python.
Usage: Select the the object you wish to move, then shift-select the object you want it to get aligned to (it aligns to its pivot).
Code: Select all
{
// Author: Luigi Tramontana @ Craft Animations
// AT: Align Translations
// Usage: Select the the object you wish to move, then shift-select the object you wich it to get aligned to (it aligns to its pivot).
string $nodes[] = `ls -selection`;
float $pos[] = `xform -query -worldSpace -scalePivot $nodes[1]`;;
move -worldSpace ($pos[0]) ($pos[1]) ($pos[2]) $nodes[0];
};