Random "Object" every frame or every other frame.

Random "Object" every frame or every other frame.

cpalmerCWG82
Observer Observer
362 Views
1 Reply
Message 1 of 2

Random "Object" every frame or every other frame.

cpalmerCWG82
Observer
Observer

I am looking to accomplish something with MaxScript that is equivalent to random plane colors every frame <-- link. The difference is I want to change the object in every frame to something else. For instance. 

 

Off to the side I have outside of camera view the following shapes:

1. Cube

2. Square

3. Ball

4. Donut

 

I have 300 frames in my animation. In the center of camera view I would like for one of these objects to be placed randomly in the center or somewhere I can manipulate (move freely). 

 

Result

 

Frame 1 = Ball

Frame 2 = Donut

Frame 3 = Cube

etc...

 

How can I accomplish this? Open to using things outside of maxscripts also...

0 Likes
363 Views
1 Reply
Reply (1)
Message 2 of 2

spacefrog_
Advisor
Advisor

The first idea for me that comes to my mind for this task would be as follows:

 

  1. Add a substitute modifier to the main object
  2. Create an array that holds the references to the replacement objects
  3. on each frame change, pick a random element from the replacement objects array
  4. Set the substitude-modifier's ObjectReference property to the picked replacement object
  5. Success !

Josef Wienerroither
Software Developer & 3d Artist Hybrid
0 Likes