Activating multiple rigid bodys at random times?

So I have a physics simulation that consists of several hundred falling tiles.
I simply need these tiles to start falling at random times between frames 1 and 20.
Any help would be appreciated.

This sounds like a job for a python script.

Thanks for the reply, I guess I will have to start learning python.

You can always click Bake to Keyframes then manually offset the resulting keyframes randomly in time. No python needed. This may only be practical for a limited count, however. Probably not reasonable for counts in the thousands of objects.

Yes, I have thought of this, but the rigid body’s still need to collide with one another during the simulation. So if they are baked and manually offseted, then some of them will intersect with each other.

Thanks for the advise and the great script, I think that I have found a solution via some simple code.

Here is the script that we came up with, it randomly picks a frame for all the objects, (whose name start with “plane”), to enable the “Dynamic” checkbox (in the physics properties), via a keyframe.

***import bpy
import random

Last starting animation

last_frame = 40

for object in bpy.data.objects:
if object.name.startswith(“Plane.”):
# Delete all existing animations
object.animation_data_clear()
# Move to the first frame
bpy.context.scene.frame_current = 1
# Turn off the rigid body
object.rigid_body.enabled = False
object.keyframe_insert(data_path=‘rigid_body.enabled’)
# Move a random number of frames
frame = random.randint(1,last_frame)
bpy.context.scene.frame_current = frame
# Enable the rigidbody and put in a keyframe
object.rigid_body.enabled = True
object.keyframe_insert(data_path=‘rigid_body.enabled’)

Properly formatted. :wink:


import random
import bpy

# Last starting animation
last_frame = 50

for object in bpy.data.objects:
  if object.name.startswith("Plane."):
    # Delete all existing animations
    object.animation_data_clear()
    # Move to the first frame
    bpy.context.scene.frame_current = 1
    # Turn off the rigid body
    object.rigid_body.enabled = False
    object.keyframe_insert(data_path='rigid_body.enabled')
    # Move a random number of frames
    frame = random.randint(1,last_frame)
    bpy.context.scene.frame_current = frame
    # Enable the rigidbody and put in a keyframe
    object.rigid_body.enabled = True
    object.keyframe_insert(data_path='rigid_body.enabled')

You can animate “Enable Deactivation”, is in Rigid Body Dynamics.