mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +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):
|
def set_ifc_file(self):
|
||||||
bpy.context.scene.BIMProperties.ifc_file = self.ifc_import_settings.input_file
|
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):
|
def calculate_unit_scale(self):
|
||||||
self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(self.file)
|
self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(self.file)
|
||||||
@@ -1527,7 +1528,6 @@ class IfcImporter:
|
|||||||
return parent @ self.get_axis2placement(plc.RelativePlacement)
|
return parent @ self.get_axis2placement(plc.RelativePlacement)
|
||||||
|
|
||||||
def set_default_context(self):
|
def set_default_context(self):
|
||||||
ContextData.load()
|
|
||||||
for subcontext in self.file.by_type("IfcGeometricRepresentationSubContext"):
|
for subcontext in self.file.by_type("IfcGeometricRepresentationSubContext"):
|
||||||
if subcontext.ContextIdentifier == "Body":
|
if subcontext.ContextIdentifier == "Body":
|
||||||
bpy.context.scene.BIMProperties.contexts = str(subcontext.id())
|
bpy.context.scene.BIMProperties.contexts = str(subcontext.id())
|
||||||
|
|||||||
@@ -18,10 +18,7 @@ class Data:
|
|||||||
cls.contexts = {}
|
cls.contexts = {}
|
||||||
for context in file.by_type("IfcGeometricRepresentationContext", include_subtypes=False):
|
for context in file.by_type("IfcGeometricRepresentationContext", include_subtypes=False):
|
||||||
subcontexts = {}
|
subcontexts = {}
|
||||||
# See bug #1224 for why we don't use HasSubContexts
|
for subcontext in context.HasSubContexts:
|
||||||
for subcontext in file.by_type("IfcGeometricRepresentationSubContext"):
|
|
||||||
if subcontext.ParentContext != context:
|
|
||||||
continue
|
|
||||||
subcontexts[int(subcontext.id())] = {
|
subcontexts[int(subcontext.id())] = {
|
||||||
"ContextType": subcontext.ContextType,
|
"ContextType": subcontext.ContextType,
|
||||||
"ContextIdentifier": subcontext.ContextIdentifier,
|
"ContextIdentifier": subcontext.ContextIdentifier,
|
||||||
|
|||||||
Reference in New Issue
Block a user