///////////////////////////////////////////////////////////////////////////////// // // Copy and Paste Vectors // // Author: Andrew Enyart // // Ceation Date: 12.11.06 // // Description: Used to easily copy and paste vectors bettween objects and files // ///////////////////////////////////////////////////////////////////////////////// string $object[] = `ls -sl`; if (`window -exists copyPaste`)deleteUI copyPaste; window -widthHeight 300 300 -title "Copy and Paste Vectors" copyPaste; columnLayout; textField -text ($object[0]) -editable true -width 200 objName; rowColumnLayout -numberOfColumns 2; text -label "Tanslate X"; floatField -value 0 -editable true -width 200 transX; text -label "Tanslate Y"; floatField -value 0 -editable true -width 200 transY; text -label "Tanslate Z"; floatField -value 0 -editable true -width 200 transZ; text -label "Rotate X"; floatField -value 0 -editable true -width 200 rotX; text -label "Rotate Y"; floatField -value 0 -editable true -width 200 rotY; text -label "Rotate Z"; floatField -value 0 -editable true -width 200 rotZ; text -label "Scale X"; floatField -value 1 -editable true -width 200 scaleX; text -label "Scale Y"; floatField -value 1 -editable true -width 200 scaleY; text -label "Scale Z"; floatField -value 1 -editable true -width 200 scaleZ; string $copyVec = `button -w 135 -h 25 -l "Copy Vectors" -command "copyVec"`; string $pasteVec = `button -w 135 -h 25 -l "Paste Vectors" -command "pasteVec"`; setParent ..; setParent ..; setParent ..; setParent ..; showWindow copyPaste; // Get the Translate, Scale and rotation of the selected object // global proc copyVec() { string $sel[] = `ls -sl`; float $tx = `getAttr ($sel[0] + ".tx")`; float $ty = `getAttr ($sel[0] + ".ty")`; float $tz = `getAttr ($sel[0] + ".tz")`; float $rx = `getAttr ($sel[0] + ".rx")`; float $ry = `getAttr ($sel[0] + ".ry")`; float $rz = `getAttr ($sel[0] + ".rz")`; float $sx = `getAttr ($sel[0] + ".sx")`; float $sy = `getAttr ($sel[0] + ".sy")`; float $sz = `getAttr ($sel[0] + ".sz")`; floatField -edit -value $tx transX; floatField -edit -value $ty transY; floatField -edit -value $tz transZ; floatField -edit -value $rx rotX; floatField -edit -value $ry rotY; floatField -edit -value $rz rotZ; floatField -edit -value $sx scaleX; floatField -edit -value $sy scaleY; floatField -edit -value $sz scaleZ; } // Apply the Translate, Scale and rotation of the selected object // global proc pasteVec() { string $sel[] = `ls -sl`; setAttr ($sel[0] + ".tx") `floatField -q -v transX`; setAttr ($sel[0] + ".ty") `floatField -q -v transY`; setAttr ($sel[0] + ".tz") `floatField -q -v transZ`; setAttr ($sel[0] + ".rx") `floatField -q -v rotX`; setAttr ($sel[0] + ".ry") `floatField -q -v rotY`; setAttr ($sel[0] + ".rz") `floatField -q -v rotZ`; setAttr ($sel[0] + ".sx") `floatField -q -v scaleX`; setAttr ($sel[0] + ".sy") `floatField -q -v scaleY`; setAttr ($sel[0] + ".sz") `floatField -q -v scaleZ`; }