Randomize attributes

Randomize attributes

Anonymous
Not applicable
987 Views
3 Replies
Message 1 of 4

Randomize attributes

Anonymous
Not applicable

Hi all, I'm new to MEL script and wanted to create a simple way of quickly randomizing certain attributes of geometric primitives. For example, if I wanted to randomize the ScaleY of pCube1 within a range of .5 to 1.5.

 

I noted in the script editor that when I manually scale in Y to .5 it says

 

scale -r 1 0.5 1 ;

My idea would be to run a command that says something like

 

scale -r 1 rand<<.5,1.5>> 1 ;

but of course this isn't the correct syntax. Could someone please give me a correct example? Thanks for your time.

 

 

0 Likes
Accepted solutions (1)
988 Views
3 Replies
Replies (3)
Message 2 of 4

mspeer
Consultant
Consultant
Accepted solution

Hi!

 

Example:

 

scale -y -a (rand(1,10));
0 Likes
Message 3 of 4

Anonymous
Not applicable

Thank you! This sets me on the right path.

0 Likes
Message 4 of 4

Anonymous
Not applicable
scale -r 1 (rand(0.5,1.5)) 1 ;
0 Likes