Closed ColinMoldenhauer closed 8 months ago
Hi Colin, thanks for the report. This is a bug that I had already fixed internally, but it was not committed to the public repository. I have now done this, please update the BCB and try again.
Thanks a lot!
Slightly off-topic, but do you by any chance know how to get the Build FM
operation to work when running Blender in the background? I am running bpy.ops.bcb.export_ascii_fm()
in my custom Python script, but when saving the file, the changes applied to the model through the simulation are not saved. Does it have to do with the animation not being played in background mode?
NVM, after hours of googling I found a way :)
Try this:
import bpy
# Get config
bpy.ops.bcb.get_config()
# Build
bpy.ops.bcb.export_ascii_fm()
# Simulate frame by frame through the timeline
scene = bpy.context.scene
for frame in range(scene.frame_start, scene.frame_end +1):
scene.frame_current = frame
bpy.context.screen.scene = scene # Scene update invokes BCB monitor event handler
Indeed, Blender doesn't seem to support animation playback in background mode, but this workaround should do the trick. I also updated the BCB to suppress some irrelevant warnings that only appear in background mode for some reason.
Dear Kai,
I am new to Blender and scripting, so this might as well be a general Blender thing, but since the affected method belongs to BCB, I thought I'd post here.
When I run the command
bpy.ops.bcb.get_config()
within the Blender Python console, it works like expected, i.e. the Element Group List is loaded correctly from file.However, when creating this simple Python script
mwe.py
and calling it with
blender --background "MY_BLEND_FILE.blend" --python mwe.py
will produce the following error:Any idea why the command only works from within the Blender UI?