2

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
Ray Mairlot
  • 29,192
  • 11
  • 103
  • 125
Olav3D
  • 21
  • 2
  • https://blender.stackexchange.com/questions/27465/running-a-script-for-each-frame might be useful? – Jackdaw Apr 03 '19 at 19:41
  • 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. – Sazerac Jul 30 '19 at 00:10

0 Answers0