Page MenuHome

Calling the Alembic export/importer from a .py script crashes Blender
Closed, ResolvedPublic


It seems like calling the alembic exporter and the alembic importer from a .py script crashes with "Error : EXCEPTION_ACCESS_VIOLATION"

If you comment the importer part, the script wont crash Blender, however exporting and importing has some weird behavior.

I tested this issue on Linux as well, the crash happens the exact same way on Linux too.

  • Add the addon below (add it as an .py addon file to your scripts folder)
  • Enable the addon (AlembicCrashes)
  • Add a cube
  • Select the cube
  • Run bpy.ops.object.alembiccrash()

This is a stripped down version of the script I was trying to write, but I cant seem to pass this stage of importing. The path in there is relative but feel free to add real paths, the result wont change.

import bpy
import os
bl_info = {
    "name" : "AlembicCrashes",
    "author" : "kursad",
    "description" : "",
    "blender" : (2, 80, 0),
    "location" : "",
    "warning" : "",
    "category" : "Generic"

class AlembicCrashesOperator(bpy.types.Operator):
    bl_idname = "object.alembiccrash"
    bl_label = "CrashAlembic"

    def execute(self, context):

        bpy.ops.wm.alembic_export(filepath="", selected=True)

        return {'FINISHED'}

def register():

def unregister():

Event Timeline

kursad k (kursadk) renamed this task from Calling the alembic export/importer from a .py script crashes Blender to Calling the Alembic export/importer from a .py script crashes Blender.Dec 11 2018, 3:33 AM
kursad k (kursadk) created this task.
kursad k (kursadk) updated the task description. (Show Details)

trace from Linux

# backtrace
./blender(BLI_system_backtrace+0x1d) [0x1b865ad]
./blender() [0x1152159]
/lib/x86_64-linux-gnu/ [0x7f35ee732fc0]
./blender(BKE_view_layer_base_deselect_all+0) [0x1965340]
./blender() [0x163756c]
./blender(wm_jobs_timer+0x10c) [0x116441c]
./blender(wm_window_process_events+0x1af) [0x117624f]
./blender(WM_main+0x18) [0x1152b58]
./blender(main+0x31e) [0x10b880e]
/lib/x86_64-linux-gnu/ [0x7f35ee71fb17]
./blender(_start+0x2a) [0x114ec3a]
Bastien Montagne (mont29) lowered the priority of this task from 90 to 50.

I am wondering if someone else also do a basic test with this to see, it crashes their Blender as wel. I cant find why this crashes Blender.

bpy.ops.wm.alembic_export(filepath="", selected=True)

Here you're doing a background export, and immediately an import of a not-yet-completely-written file. Try adding as_background_job=False to the export call.


Thanks for the follow up, I am going to test it and follow up here.

as_background_job=False is no longer necessary, as this is now the default when executing the import/export operators from Python.