Home Technical Talk

Maxscript help, Random Rotate between set values

polycounter lvl 13
Offline / Send Message
Fwap polycounter lvl 13
Utter maxscript nub in coming.

I've been following some tutorials on it such as, https://www.youtube.com/watch?v=ZKcBHwLvAu0

But i'm in dire need to convert that script from a random transformation value between 2 values to randomly between pre determined values.

For example i have a bunch of generic high poly bricks i'm using for my texture work, i want maxscript to handle the rotating of the bricks.
X axis between -90, 90, -180, 180, -270, or 270.

Thanks

Replies

  • Fwap
    Offline / Send Message
    Fwap polycounter lvl 13
    Kind of figured it out, it looks pretty dirty to me;
    for rotateby90 in selection do
    (
    rotate rotateby90 (eulerAngles ((random 1 8)*90) (0) (0))
    )
    


    so if anyone has a cleaner way? or maybe this was is fundamentally flawed and i just can't see it?
  • Noors
    Offline / Send Message
    Noors greentooth
    Looks pretty clean to me.
    270 == -90 , 180 == - 180 ...
    so you could rand only between 1 and 4, (not that it changes anything).
    for obj in selection do
    (
        rot = eulerAngles ((random 1 4)*90) 0 0
        rotate obj rot
    )
    
Sign In or Register to comment.