Python module bpy - Mantaflow issues after successful build

Hi everyone,

My first post here so please excuse me if I mix something up. :slight_smile:

I built Blender as a Python module under Linux to run and render fluid simulations for a Computer Vision project. I am working on an automated pipeline.

I was able to built the Python module successfully using the make bpy target with the precompiled libraries. However, I made some adjustments to the “bpy_module.cmake” file: I enabled portable installation (for usage in a virtual Python environment), OpenCOLLADA, Alembic, Bullet, CUDA binaries and OpenVDB. I tried two different branches: the 2.90-release and the latest master (as of today).

After installing the module in the environment using make install essentially everything works fine when importing the module: Loading and modifying scenes, importing “.obj” files, setting up the fluid domain and so on. But when I try to bake the simulation using bpy.ops.fluid.bake_data() I get this error:

`
Python 3.7.5 (default, Aug 10 2020, 11:44:05)
[GCC 10.1.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import bpy
bpy.ops.object.quick_liquid()
Traceback (most recent call last):
File “”, line 109, in
AttributeError: ‘LevelsetGrid’ object has no attribute ‘setConst’
Traceback (most recent call last):
File “”, line 35, in
AttributeError: ‘BasicParticleSystem’ object has no attribute ‘create’
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘fluid_adapt_time_step_1’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘bake_fluid_data_1’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘liquid_save_data_1’ is not defined
Traceback (most recent call last):
File “”, line 109, in
AttributeError: ‘LevelsetGrid’ object has no attribute ‘setConst’
Traceback (most recent call last):
File “”, line 35, in
AttributeError: ‘BasicParticleSystem’ object has no attribute ‘create’
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘fluid_adapt_time_step_2’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘bake_fluid_data_2’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘liquid_save_data_2’ is not defined
Traceback (most recent call last):
File “”, line 109, in
AttributeError: ‘LevelsetGrid’ object has no attribute ‘setConst’
Traceback (most recent call last):
File “”, line 35, in
AttributeError: ‘BasicParticleSystem’ object has no attribute ‘create’
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘fluid_adapt_time_step_3’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘bake_fluid_data_3’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘liquid_save_data_3’ is not defined
Traceback (most recent call last):
File “”, line 109, in
AttributeError: ‘LevelsetGrid’ object has no attribute ‘setConst’
Traceback (most recent call last):
File “”, line 35, in
AttributeError: ‘BasicParticleSystem’ object has no attribute ‘create’
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘fluid_adapt_time_step_4’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘bake_fluid_data_4’ is not defined
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘liquid_save_data_4’ is not defined
{‘FINISHED’}
`

As you can see this error occurs even in the most simple case: Fresh scene, default cube and the quick liquid convenience function. To me it seems like some of the Mantaflow source code has not built correctly. But, I have no idea what causes this error and the traceback is not useful for me either. Aside from that, I am not sure whether this issue is related to my built and what information I can provide to give more context. Unfortunately I don’t have much experience with software development, building etc. Please let me know what might be useful.

Edit: Note that the fluid bake runs without problems when I built “standard” Blender with make full.

Thanks! J.

Hi,
recently i have encountered the same problem as you, when building blender as a python module, did you find any solutions to it?
I know that it’s a bit late, but i thought that i would give it a shot.
Thanks!