1
$\begingroup$

I am trying to script the baking of two fluid domains. If I manually bake these in the UI: no problem. If I try to run a script from the UI, the application aborts and I cannot read the console in time to get information.

I have the following script.py, which works with no problems if I feed line by line into the UI Python Console, but crashes if I Alt-P Run Script:

import bpy

domain =  bpy.data.objects['Smoke Domain Purple']
domain.select_set(True)
print("free Purple")
bpy.ops.fluid.free_all()
print("bake Purple")
bpy.ops.fluid.bake_data()
domain.select_set(False)
domain =  bpy.data.objects['Smoke Domain Blue']
domain.select_set(True)
print("free Blue")
bpy.ops.fluid.free_all()
print("bake Blue")
bpy.ops.fluid.bake_data()
domain.select_set(False)

If I run from cmd line (Win-10) started as admin: blender -b "dual smoke.blend" --python script.py

I get the following output in three scenarios.

  1. no existing fluid directories:
free Purple
bake Purple
Unable to remove directory
Unable to remove directory

Yet only the second (!) "blue" directory (cache_smoke_blue) is created empty.

  1. manually bake both fluids, and a re-run from cmd line shows:
free Purple
bake Purple
Unable to remove directory
Unable to delete file
... <one per frame baked>
Unable to delete file
Unable to remove directory
Unable to delete file
... <one per frame baked>
Unable to delete file
Info: Fluid: Bake Data complete! (0.31)
free Blue
bake Blue
Info: Fluid: Bake Data complete! (0.13)
Info: Fluid: Free All complete! (0.62)
addon_utils.disable: space_view3d_copy_attributes not loaded
Unregistered Animation Nodes

(only the last frame of "purple" domain remains, Blue domain now contains no files).

  1. another re-run from cmd line shows:
free Purple
bake Purple
Unable to remove directory
Unable to delete file
Unable to remove directory
Unable to delete file
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF7BD310A56
Module  : blender.exe
Thread  : 00004b40
Writing: C:\Users\James\AppData\Local\Temp\dual smoke.crash.txt

where the crash.txt is your typical stack trace eye chart with perhaps the significant lines:

Stack trace:
blender.exe         :0x00007FF7BD310A30  std::_Hash<std::_Umap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,v
blender.exe         :0x00007FF7BFE3C220  MANTA::parseLine
blender.exe         :0x00007FF7BFE3C7E0  MANTA::parseScript
blender.exe         :0x00007FF7BFE314C0  MANTA::initHeat
blender.exe         :0x00007FF7BFE251B0  MANTA::MANTA
blender.exe         :0x00007FF7BC478A60  BKE_fluid_modifier_init
blender.exe         :0x00007FF7BC478CD0  BKE_fluid_modifier_processDomain
blender.exe         :0x00007FF7BC478530  BKE_fluid_modifier_do

some sort of malloc() problem?

blender 2.92 file that contains the script in the Text panel:

$\endgroup$
1
  • $\begingroup$ It turns out that it is the invocation of free_all() that is causing the crash. I will report this as a bug. $\endgroup$
    – james_t
    Commented Jun 11, 2021 at 16:27

1 Answer 1

1
$\begingroup$

According to the developer bug tracker at blender.org, it is a bug.

$\endgroup$

You must log in to answer this question.

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