Rotate Multiple Objects Around a Common Center

Rotate Multiple Objects Around a Common Center

experimentaldJ
Explorer Explorer
1,624 Views
7 Replies
Message 1 of 8

Rotate Multiple Objects Around a Common Center

experimentaldJ
Explorer
Explorer

Rotating multiple objects around a common center inside of 3ds Max is easy. Select everything, rotate.

 

How do you accomplish this in maxscript?

 

I've figured out how to rotate my selected objects one at a time around the selection center, but that is not the same as rotating them together. The selection center moves after rotating one object so the rest are rotated around a new selection center.

0 Likes
Accepted solutions (2)
1,625 Views
7 Replies
Replies (7)
Message 2 of 8

denisT.MaxDoctor
Advisor
Advisor

see the MXS help about

 

The about <center_spec> context is the MAXScript equivalent of the rotate/scale transform center list on the main 3ds Max toolbar.

 

 

delete objects
--seed 0
for k=1 to 5 do (teapot radius:(random 10 60) pos:(random -[100,100,100] [100,100,100]))
	
center = random -[100,100,100] [100,100,100]
point pos:center wirecolor:green
	
rotate objects (eulerangles 0 0 45) about center

 

0 Likes
Message 3 of 8

experimentaldJ
Explorer
Explorer

Sorry I should have been more clear. I need to rotate all objects around the selection center. I can't find anything on getting the "center" from "selection".

0 Likes
Message 4 of 8

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

 

 

rotate selection (eulerangles 0 0 45) about selection

 

did you read the help?

 

or about selection bounding box center:

 

rotate selection (eulerangles 0 0 90) about (selection.center)

 

0 Likes
Message 5 of 8

experimentaldJ
Explorer
Explorer

Neither of those work...

0 Likes
Message 6 of 8

denisT.MaxDoctor
Advisor
Advisor

@experimentaldJ wrote:

Neither of those work...



if it doesn't work, it means you're doing something wrong...

0 Likes
Message 7 of 8

experimentaldJ
Explorer
Explorer
Accepted solution

The correct line is:

 

about (selection.center) rotate selection (eulerangles 0 0 90)

0 Likes
Message 8 of 8

denisT.MaxDoctor
Advisor
Advisor

@experimentaldJ wrote:

The correct line is:

 

about (selection.center) rotate selection (eulerangles 0 0 90)


c'mon ... what's the difference? 😉

0 Likes