Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   a script that moves the pivot at the origin (https://simplymaya.com/forum/showthread.php?t=13237)

vladimirjp 26-08-2004 03:11 PM

a script that moves the pivot at the origin
 
hello. i know there are a few MEL savvy mods on this forum, as MEL is not my favorite thing to do. this may seem like a simple 4-5 line script to most, but i've tried and all failed miserably. heh.. i won't even post my so called "code" as it was way off...
so please a little help to speed my modeling process and technique.

read title: a simple script that takes the pivot of object selected and places the pivot at the origin [0 0 0]any object type or mesh etc... ,


thanx in advance :):tup:

vladimirjp 26-08-2004 03:39 PM

what i had....
string $selected[];
$selected = `ls -sl`;
vector $pivot = `xform -q -piv $selected`;
move $selected.rotatePivot $selected.scalePivot 0 0 0;

error i got : Error: line 3: Cannot convert data of type float[] to type vector due to array size mismatch (6 elements). //

kbrown 26-08-2004 04:16 PM

There... make shelf button of this or something...
Code:

{
        string $sSel[] = `ls -sl -typ transform`;
        string $sItem;

        for($sItem in $sSel)
        {
                setAttr ($sItem + ".scalePivot") 0 0 0;
                setAttr ($sItem + ".rotatePivot") 0 0 0;
        }
}


vladimirjp 26-08-2004 04:34 PM

thanx a million sensei KB:chinese:
:tup: :tired: Mel is on my next "to-learn" list


All times are GMT. The time now is 04:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018