I'm having a lot of difficulty trying to change the start and end frame of a rigid body physics simulation with python. Changing the settings in the UI shows the following in info view:

bpy.context.scene.frame_end = 850

However, running this will change the end frame of the timeline, which is not what I want. I saw the following post which solves this for cloth simulation, however this doesn't work, because the rigid body physics are not employed as a "Modifier". (Change the start frame and end frame of a bake in Blender using script)

Perhaps I have to change the context and then running the above code? I would appreciate any help implementing this, or any other way to achieve this effect.


Just figured this out, hopefully this helps someone else. If you access the point cache within the rigid body world, this has a frame start and frame end which you can change with, for example:

scene.rigidbody_world.point_cache.frame_start = 1
scene.rigidbody_world.point_cache.frame_end = 1000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.