Fix #1632. Fix bug where you couldn't load the add-on in background mode. Thanks s-leger!

This commit is contained in:
Dion Moult
2021-08-07 20:35:08 +10:00
parent 176e22af8b
commit a874a6b673
@@ -33,7 +33,8 @@ addon_keymaps = []
def register():
bpy.utils.register_tool(workspace.BimTool, after={"builtin.scale_cage"}, separator=True, group=True)
if not bpy.app.background:
bpy.utils.register_tool(workspace.BimTool, after={"builtin.scale_cage"}, separator=True, group=True)
bpy.types.Scene.BIMModelProperties = bpy.props.PointerProperty(type=prop.BIMModelProperties)
bpy.types.VIEW3D_MT_mesh_add.append(grid.add_object_button)
bpy.types.VIEW3D_MT_mesh_add.append(stair.add_object_button)
@@ -50,7 +51,8 @@ def register():
def unregister():
bpy.utils.unregister_tool(workspace.BimTool)
if not bpy.app.background:
bpy.utils.unregister_tool(workspace.BimTool)
del bpy.types.Scene.BIMModelProperties
bpy.app.handlers.load_post.remove(handler.load_post)
bpy.types.VIEW3D_MT_mesh_add.remove(grid.add_object_button)