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.
This commit is contained in:
Andrej730
2024-06-11 18:06:35 +05:00
parent 13c6b9d673
commit 2e2c116180
@@ -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(