Fix regression in last release where the file was loaded twice during import, which led to increased import times

This commit is contained in:
Dion Moult
2021-02-24 12:51:50 +11:00
parent d50c89abee
commit eeb27bb1c7
2 changed files with 3 additions and 6 deletions
@@ -1104,7 +1104,8 @@ class IfcImporter:
def set_ifc_file(self):
bpy.context.scene.BIMProperties.ifc_file = self.ifc_import_settings.input_file
IfcStore.path = "self.ifc_import_settings.input_file"
IfcStore.file = self.file
IfcStore.path = self.ifc_import_settings.input_file
def calculate_unit_scale(self):
self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(self.file)
@@ -1527,7 +1528,6 @@ class IfcImporter:
return parent @ self.get_axis2placement(plc.RelativePlacement)
def set_default_context(self):
ContextData.load()
for subcontext in self.file.by_type("IfcGeometricRepresentationSubContext"):
if subcontext.ContextIdentifier == "Body":
bpy.context.scene.BIMProperties.contexts = str(subcontext.id())
@@ -18,10 +18,7 @@ class Data:
cls.contexts = {}
for context in file.by_type("IfcGeometricRepresentationContext", include_subtypes=False):
subcontexts = {}
# See bug #1224 for why we don't use HasSubContexts
for subcontext in file.by_type("IfcGeometricRepresentationSubContext"):
if subcontext.ParentContext != context:
continue
for subcontext in context.HasSubContexts:
subcontexts[int(subcontext.id())] = {
"ContextType": subcontext.ContextType,
"ContextIdentifier": subcontext.ContextIdentifier,