View Full Version : help needed - mel to place all pivots to center of the grid

02 February 2009, 04:57 PM
My knowledge of mel is very weak, non existent almost :)

I need a script that will place pivot point of all selected object in the center of the grid

I thought to start with select -hi, but that's all I could think of :)

Hope someone can find some time to help.

Thanks in advance,


02 February 2009, 06:11 PM
for($obj in `ls -sl -type "transform"`){
xform -ws -piv 0 0 0 $obj;

Hope that helps...

02 February 2009, 06:49 PM
I'd rather select objects via Outliner, hit insert and snap it to the middle. Using script can cause you a lot of pain later is something moves which shouldn't.

02 February 2009, 12:05 AM
works like charm.

big respect :)

@benio33, thanks for advice. I just export finished model from maya for further use. And all pivots need to be in the center of the grid before I do that. So there's no worry that something will be moved :)

CGTalk Moderation
02 February 2009, 12:05 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.