0

As per title. Minimal code example is:

import bpy
bpy.ops.object.modifier_add(type='FLUID')
bpy.ops.object.material_slot_add()
bpy.ops.object.quick_smoke()
bpy.context.scene.frame_end = 10
bpy.ops.render.render(animation=True)

Interestingly, if I do bpy.ops.screen.animation_play(), let it finish and then bpy.ops.render.render(animation=True), the smoke renders correctly!

Tested on both Mac and Windows.

bosmart
  • 101
  • 1
    Imagine this is similar Run the bake operator for smoke.. https://blender.stackexchange.com/questions/112029/is-there-any-way-to-export-the-last-frame-of-a-physics-simulation-from-command-l As mentioned Playing the animation first also bakes. – batFINGER Jun 09 '20 at 07:59
  • Yes, baking was the answer - I knew animation_play() must have been doing something extra. Adding bpy.ops.fluid.bake_data() before bpy.ops.render.render(animation=True) solved it! – bosmart Jun 09 '20 at 11:01

0 Answers0