From 2e2c116180da6d5a3badc3ee0b06c55d5063b214 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 11 Jun 2024 18:06:35 +0500 Subject: [PATCH] deprecate mixing up ifc materials and styles in one blender material on loading #4843 Part of the transition process disconnecting blender materials from IFC materials to make it less confusing. E.g. previously if we would load an element A with material M and style S it would load it as blender material M that looks like S. But also if you would load element B with just style S, it would add it as blender material M though B has nothing to do with material M. --- src/blenderbim/blenderbim/bim/import_ifc.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/import_ifc.py b/src/blenderbim/blenderbim/bim/import_ifc.py index 5c5a8c23a2..dce855a838 100644 --- a/src/blenderbim/blenderbim/bim/import_ifc.py +++ b/src/blenderbim/blenderbim/bim/import_ifc.py @@ -1614,26 +1614,7 @@ class IfcImporter: return blender_material def create_styles(self) -> None: - parsed_styles = set() - - for material_definition_representation in self.file.by_type("IfcMaterialDefinitionRepresentation"): - material = material_definition_representation.RepresentedMaterial - blender_material = self.material_creator.materials[material.id()] - for representation in material_definition_representation.Representations: - styles = [] - for styled_item in representation.Items: - styles.extend(styled_item.Styles) - while styles: - style = styles.pop() - if style.is_a("IfcSurfaceStyle"): - self.create_style(style, blender_material) - parsed_styles.add(style.id()) - elif style.is_a("IfcPresentationStyleAssignment"): - styles.extend(style.Styles) - for style in self.file.by_type("IfcSurfaceStyle"): - if style.id() in parsed_styles: - continue self.create_style(style) def create_style(