← All ideas
  • Published 26 Jan 2021

Bake physics from command line

Could be useful to bake physics from the command line. Thanks

100%

Development Status: Open

Upvote 3 Downvote 0
mamik77777
26 Jan 2021

4 Comments

PTCreative

Hi, pretty much anything can be done form command line. In this case you'll want use a python expression. In your teminal/command prompt try ;

"your path to blender.exe" -b "path to your .blend file" --python-expr-- "import bpy; bpy.ops.ptcache.bake_all()"

This example is for particles and cloth, you'l also need to enable disk cache beforehand so you can load the cache files having not saved them internally. docs.blender.org/manual/en/latest/advanced/command_line/render.html

Lauloque

* @PTCreative * I've never seen the --python-expr-- argument in use, and I wish I had sooner! Where is this in the manual?

Anyways, I think things as baking deserve their own dedicated command lines as much as rendering, so I upvote this right away.

Lauloque

* @PTCreative * i know that page, the issue is it just shows the command, not how to write the python lines nor the limitations