mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-01 01:16:27 +00:00
util.shape for materials and material_ids
This commit is contained in:
@@ -70,17 +70,6 @@ class MaterialCreator:
|
||||
|
||||
self.mesh = mesh
|
||||
self.obj = obj
|
||||
|
||||
# mesh["ios_materials"] can contain:
|
||||
# - ifc style id if style assigned to the representation items directly
|
||||
# or through material with a style;
|
||||
# - ifc material id if both true:
|
||||
# - element has a material without a style;
|
||||
# - there are parts of the geometry that has no other style assigned to them;
|
||||
# - -1 in case if there is no material;
|
||||
# - 0 in case if there are default materials used.
|
||||
# Though 0 value will not occur as we don't use default materials in IfcImporter.
|
||||
|
||||
self.parsed_meshes.add(self.mesh.name)
|
||||
self.load_texture_maps(shape_has_openings)
|
||||
self.assign_material_slots_to_faces()
|
||||
|
||||
@@ -1567,7 +1567,7 @@ class LoadLinkedProject(bpy.types.Operator):
|
||||
has_processed_chunk = False
|
||||
|
||||
ms = np.vstack([default_mat, ifcopenshell.util.shape.get_material_colors(shape.geometry)])
|
||||
mi = np.frombuffer(shape.geometry.material_ids_buffer, dtype=np.int32)
|
||||
mi = ifcopenshell.util.shape.get_faces_material_style_ids(shape.geometry)
|
||||
for geom_material_idx, geom_material in enumerate(shape.geometry.materials):
|
||||
if not geom_material.instance_id():
|
||||
ms[geom_material_idx + 1] = (0.8, 0.8, 0.8, 1)
|
||||
|
||||
Reference in New Issue
Block a user