Make wall preview decorator work only with IfcWallType.

This commit is contained in:
Bruno Perdigão
2024-10-22 17:32:48 -03:00
parent c18d2e8c17
commit ffe8d4fad2
@@ -1074,12 +1074,13 @@ class ProductDecorator:
self.relating_type = tool.Ifc.get().by_id(int(relating_type_id)) self.relating_type = tool.Ifc.get().by_id(int(relating_type_id))
# Wall # Wall
wall_preview_data = self.get_wall_preview_data(context, self.relating_type) if self.relating_type.is_a("IfcWallType"):
if wall_preview_data: wall_preview_data = self.get_wall_preview_data(context, self.relating_type)
self.draw_batch("LINES", wall_preview_data["verts"], decorator_color, wall_preview_data["edges"]) if wall_preview_data:
self.draw_batch( self.draw_batch("LINES", wall_preview_data["verts"], decorator_color, wall_preview_data["edges"])
"TRIS", wall_preview_data["verts"], transparent_color(decorator_color), wall_preview_data["tris"] self.draw_batch(
) "TRIS", wall_preview_data["verts"], transparent_color(decorator_color), wall_preview_data["tris"]
)
# Mesh type products # Mesh type products
product_preview_data = self.get_product_preview_data(context, self.relating_type) product_preview_data = self.get_product_preview_data(context, self.relating_type)