mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix regression in last release where the file was loaded twice during import, which led to increased import times
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user