mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Fix https://github.com/IfcOpenShell/IfcOpenShell/issues/1667 : Passed scene is None when creating file
This commit is contained in:
@@ -182,6 +182,8 @@ def redo_pre(scene):
|
||||
|
||||
@persistent
|
||||
def redo_post(scene):
|
||||
if scene is None:
|
||||
scene = bpy.context.scene
|
||||
if IfcStore.last_transaction != scene.BIMProperties.last_transaction:
|
||||
IfcStore.last_transaction = scene.BIMProperties.last_transaction
|
||||
IfcStore.redo()
|
||||
@@ -192,6 +194,8 @@ def redo_post(scene):
|
||||
|
||||
@persistent
|
||||
def ensureIfcExported(scene):
|
||||
if scene is None:
|
||||
scene = bpy.context.scene
|
||||
if IfcStore.get_file() and not scene.BIMProperties.ifc_file:
|
||||
bpy.ops.export_ifc.bim("INVOKE_DEFAULT")
|
||||
|
||||
@@ -225,6 +229,8 @@ def get_application_version():
|
||||
|
||||
@persistent
|
||||
def setDefaultProperties(scene):
|
||||
if scene is None:
|
||||
scene = bpy.context.scene
|
||||
global global_subscription_owner
|
||||
active_object_key = bpy.types.LayerObjects, "active"
|
||||
bpy.msgbus.subscribe_rna(
|
||||
|
||||
Reference in New Issue
Block a user