Fix #1989. Fix bug where you couldn't export to IfcJSON, since it couldn't be imported again.

This commit is contained in:
Dion Moult
2022-01-14 18:55:44 +11:00
parent f8c7f48674
commit d63be20c8b
2 changed files with 13 additions and 1 deletions
@@ -802,7 +802,7 @@ class ExportIFC(bpy.types.Operator):
new.name = output_file
if self.use_relative_path and bpy.data.is_saved:
output_file = os.path.relpath(output_file, bpy.path.abspath("//"))
if scene.BIMProperties.ifc_file != output_file:
if scene.BIMProperties.ifc_file != output_file and extension not in ["ifczip", "ifcjson"]:
scene.BIMProperties.ifc_file = output_file
if bpy.data.is_saved and bpy.data.is_dirty and bpy.data.filepath:
bpy.ops.wm.save_mainfile(filepath=bpy.data.filepath)
@@ -332,6 +332,18 @@ Scenario: Export IFC - with basic contents and saving as another file
When I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifc', should_save_as=True)"
Then "scene.BIMProperties.ifc_file" is "{cwd}/test/files/export.ifc"
Scenario: Export IFC - with basic contents and saving as IfcJSON where import is not supported
Given an empty Blender session
And I press "bim.load_project(filepath='{cwd}/test/files/basic.ifc')"
When I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifcjson', should_save_as=True)"
Then "scene.BIMProperties.ifc_file" is "{cwd}/test/files/basic.ifc"
Scenario: Export IFC - with basic contents and saving as IfcZip where import is not supported
Given an empty Blender session
And I press "bim.load_project(filepath='{cwd}/test/files/basic.ifc')"
When I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifczip', should_save_as=True)"
Then "scene.BIMProperties.ifc_file" is "{cwd}/test/files/basic.ifc"
Scenario: Export IFC - with basic contents and saving as a relative path
Given an empty Blender session
And I press "bim.load_project(filepath='{cwd}/test/files/basic.ifc')"