PDA

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


djorzgul
02-27-2009, 03: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,

dj.

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

Hope that helps...

benio33
02-27-2009, 05: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.

djorzgul
02-27-2009, 11:05 PM
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-27-2009, 11:05 PM
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.