ScriptSpot

Forum topic · General Scripting

Help a Noob v0.01? "Rotate Multiple Objects around Center"

By toonhound · 2010-03-01

Description

I have just started learning a little maxscript, and will probably be needing a lot of help, hence the title v0.01.

I'm trying to rotate a character mesh that is broken up into 39 actual mesh body parts.

problem is that when I apply this script all the 39 separate parts seem to only rotate around their own center.

this is the script I used:

select $mesh* --selects all 39 parts
rotate $ (angleaxis 90 [1,0,0])

I would like them to rotate as if I selected them all as a whole in the viewport and then rotated them around the center.
basically just take a whole character model and stand it up from a laying position.

Comments (2)

Anubis · 2010-03-01

The expresion "$.center" will give you a center of all selected objects and using mxs special keyword "about" you can write a expression like this:

about $.center rotate $ (angleaxis 90 [1,0,0])

Of course, this way, the center will be strongly relative to the character pose, so if you use linked hierarchy for your character, you can rotate only the top-head parent and the children will folow it.

toonhound · 2010-03-01

Thank You,

That worked perfectly in my case as it was just a character in T-pose with no linked hierarchy.:)

Thanks again