2
$\begingroup$

I am trying to figure out how I can spawn rigid body objects, one for each frame. Imagine cubes falling down from a point orderly, sort of like a particle emitter. My problem is that all the 250 objects keep spawning in the first frame when I run the script. How can I make sure they appear at different frames?

import bpy

number = 250
frame_num = 0

for i in range(0,number):
    bpy.context.scene.frame_set(frame_num)
    bpy.ops.mesh.primitive_cube_add(location=(0,0,0))
    bpy.ops.rigidbody.object_add()
    frame_num += 1
$\endgroup$
  • $\begingroup$ blender.stackexchange.com/questions/27465/… might be useful? $\endgroup$ – Jackdaw Apr 3 '19 at 19:41
  • $\begingroup$ Objects exist or don't, you can't make them exist only on certain frames. What you can do is keyframe things like visibility and various rigid body settings to make them invisible and inactive until you need them. $\endgroup$ – Sazerac Jul 30 '19 at 0:10

Browse other questions tagged or ask your own question.