Wednesday, July 23, 2008

Maya MEL Script - Key Mover


Script that moves all de keys of each selected object an specific number of frames. It helps to create a sequence movements.

//Ventana
window -title "Desplazador de keys" Desplaza1;
columnLayout -columnAttach "both" 5 -rowSpacing 10 -columnWidth 250;
text -l "1. Selecciona los objetos a modificar.";
text -l "2. Cuanto se desplazan los keys";
intField -w 80 -value 1 -minValue 0 mueve;
button -label "Aplicar" -command ("aplica()");
button -label "Close" -command ("deleteUI -window Desplaza1");
showWindow;

// Secuencia de Cerecer
global proc aplica() {
string $selection[] = `ls -selection`;
int $a = size($selection);
int $mueve = `intField -q -value "mueve"`;
for( $i = 0; $i < $a; $i++ ){ select ($selection[$i]); selectKey -clear; selectKey; keyframe -e -iub true -r -o over -tc ($i * $mueve); }; };

No comments: