Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

set multiple objects rotation values to 0

set multiple objects rotation values to 0

grue1970
Collaborator Collaborator
3,162 Views
5 Replies
Message 1 of 6

set multiple objects rotation values to 0

grue1970
Collaborator
Collaborator

hello.  how can i use maxscript to set the current rotation values of multiple objects to be equal to zero?  i'm not having a lot of luck searching for this.  i did find a script that seems to do the trick, however that script also moves the object quite a distance from where it originally is.  for example some objects i've selected in the viewport are moved a couple hundred feet in the + z world axis, some moved in all 3 world axis several hundred feet.

 

$.rotation = eulerangles 0 0 0

 

i'm hoping to find a solution where i can just type it in, vs. a maxscript that has a UI and several options.

 

thanks!

 

 

3ds Max all versions past and present | GPU Rendering on 2 machines | Standard, MentalRay, MentalRay IRAY, IRAY+, VRAY, Arnold
0 Likes
Accepted solutions (1)
3,163 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
for node in selection do node.transform = translate(scalematrix node.scale) node.pos
0 Likes
Message 3 of 6

denisT.MaxDoctor
Advisor
Advisor

or

for node in selection do node.rotation.controller.value = quat 1
0 Likes
Message 4 of 6

denisT.MaxDoctor
Advisor
Advisor

both solutions above don't really work if a rotation has keys (animation). animated rotation should be completely replaced.

for exampe:

for node in selection do node.rotation.controller = createinstance euler_xyz
0 Likes
Message 5 of 6

grue1970
Collaborator
Collaborator

thanks a ton this worked great!  i had about 200 2d people that were rotated at different angles on at least 2 axis because of a look-at contraint (to a camera).  i wanted to get them all rotated back to "zero" so i can reapply helpers and look-at's.

 

definitely going to read about this in the manual.

3ds Max all versions past and present | GPU Rendering on 2 machines | Standard, MentalRay, MentalRay IRAY, IRAY+, VRAY, Arnold
0 Likes
Message 6 of 6

mateusz.omanskI
Participant
Participant

I know it has been a while since the topic have been closed but I wonder if it is possible to do this trick but only to one particular axis? I am total lame in maxscript, so if someone have an idea how to do it I would be very greatful 🙂

0 Likes