Notifications
Clear all

[Closed] Rotate in coordsys world

Hi
I’m trying to create a button in my script to rotate a bunch of selected objects around, like what the toolbar rotation dose when in World Coordsys mode (or view Cordsys). I’ve tried this code:

in coordsys world rotate selection (EulerAngles 0 0 90)

This code works for one object but when more than one objects are selected the objects rotate around their local coordsys. I want the whole selection to rotate.
Could you please help me. Thank you.

8 Replies

to rotate around the origin you can use

$.transform *= (EulerAngles 0 0 90) as Matrix3 

or

$selection.transform *= (EulerAngles 0 0 90) as Matrix3 

or

selection.transform *= (EulerAngles 0 0 90) as Matrix3 

all of which will rotate the current selection

does it work?


in coordsys world about [0,0,0] rotate selection (EulerAngles 0 0 90)

1 Reply
(@abclook)
Joined: 10 months ago

Posts: 0

The ” about [0,0,0] ” changed the line from local to world coordsys for me.
thank you very much.

Thanks a lot, these are very helpful and all of them work perfectly for my purpose.

Instead of ” about [0,0,0] ” is it possible to use center of a selection? For example a bunch of objects are selected and I want to rotate around center of all of theme regardless of their position in scene. I can’t find pivot of a selection in Max Help. thank you.

in coordsys world about $selection.center rotate $selection (EulerAngles 0 0 90)

I’ve found These:

in coordsys world about selection rotate selection (EulerAngles 0 0 90)

or

about selection in coordsys grid rotate selection (EulerAngles 0 0 60)

Both of theme cause strange result. every time these lines are executed for a bunch of selected objects objects move to, apparent to my eye, random different directions. why “in coordsys world about selection” dose this strange thing?

Like always Genius Klunk. Wow Thank you. I just see you reply. Very nice and simple. thank you. WoW