mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +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
|
@persistent
|
||||||
def redo_post(scene):
|
def redo_post(scene):
|
||||||
|
if scene is None:
|
||||||
|
scene = bpy.context.scene
|
||||||
if IfcStore.last_transaction != scene.BIMProperties.last_transaction:
|
if IfcStore.last_transaction != scene.BIMProperties.last_transaction:
|
||||||
IfcStore.last_transaction = scene.BIMProperties.last_transaction
|
IfcStore.last_transaction = scene.BIMProperties.last_transaction
|
||||||
IfcStore.redo()
|
IfcStore.redo()
|
||||||
@@ -192,6 +194,8 @@ def redo_post(scene):
|
|||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def ensureIfcExported(scene):
|
def ensureIfcExported(scene):
|
||||||
|
if scene is None:
|
||||||
|
scene = bpy.context.scene
|
||||||
if IfcStore.get_file() and not scene.BIMProperties.ifc_file:
|
if IfcStore.get_file() and not scene.BIMProperties.ifc_file:
|
||||||
bpy.ops.export_ifc.bim("INVOKE_DEFAULT")
|
bpy.ops.export_ifc.bim("INVOKE_DEFAULT")
|
||||||
|
|
||||||
@@ -225,6 +229,8 @@ def get_application_version():
|
|||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def setDefaultProperties(scene):
|
def setDefaultProperties(scene):
|
||||||
|
if scene is None:
|
||||||
|
scene = bpy.context.scene
|
||||||
global global_subscription_owner
|
global global_subscription_owner
|
||||||
active_object_key = bpy.types.LayerObjects, "active"
|
active_object_key = bpy.types.LayerObjects, "active"
|
||||||
bpy.msgbus.subscribe_rna(
|
bpy.msgbus.subscribe_rna(
|
||||||
|
|||||||
Reference in New Issue
Block a user