Notifications
Clear all

[Closed] Problem / Random rotation on selected objects

Hi, I am trying to create a script which allows selected objects
to rotate randomly. I managed to get the random rotation going
but all objects are rotating at the same angle. What I want is
to make all seleced objects rotate in different angles

3 Replies

sarr = selection as array
count = sarr.count + 1
i = 1
while i < count do
(
select sarr[i]
rotate $ (eulerangles (random 0 360) (random 0 360) (random 0 360))
i += 1
)

I’m not very good at MAXScript, but you can use this script to rotate all selected objects in a random way.

 PEN

Or Simplier.

<code>
for x in selection do
(
rotate x (eulerAngles (random -360 360) (random -360 360) (random -360 360))
)
</code>

The code posted by KaMe needs to have the the object selected to work. This will slow the process down allot as selections have to keep changing.

Yeah thats true when you have a lot of objects in the scene…
Your script is much simplier and much faster. I didn’t know of this MAXScript ‘ability’, really good to know. :]