6
$\begingroup$

After this python line bpy.ops.fluid.bake_all(), blender --background starts baking yet nothing is displayed until it's done and prints e.g. Info: Fluid: Bake All complete! (70.69)

Any hint's on how to print the gui's progressbar on the commandline?

e.g.

$ blender --background --python my_manta_bake.py

Fluid bake: 1%
Fluid bake: 2%
Fluid bake: 3%
..

https://docs.blender.org/api/current/bpy.ops.fluid.html#bpy.ops.fluid.bake_all pic

$\endgroup$

1 Answer 1

3
+50
$\begingroup$

TL;DNR: You would need to change Blender's C source code to make the information available.

Obtaining that information at run time would require being able to register an callback handler for baking. These are sometimes called callbacks, but the blender Python manual calls them handlers.

There are no callbacks for baking, despite this request on RightClick. Someone even tried to file this bug report.

You can find the mostly complete list of available app callback handlers in the manual.

The other way that can sometimes be used is Blender's version of Message Bus but that only works if the change in the displayed percentage were available through what is called the "RNA" system. Baking does not expose its progress percentage this way.

$\endgroup$
2
  • $\begingroup$ Where in the C code would you start to contribute the callback as new feature? P.S. Can you please the fix the url to list of available callback handlers? It seems to be a duplicate $\endgroup$
    – jjk
    Commented Feb 2, 2022 at 14:21
  • 1
    $\begingroup$ @jjk you're right, the list was a dup. I fixed it. I don't know the source code well enough to know, but I would start my search by looking at the implementation of one of the existing handlers on Blender github. $\endgroup$ Commented Feb 2, 2022 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .