From f3ab21475210ba1778f94ca81db1904e588e45ac Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 29 Aug 2024 17:21:18 +0500 Subject: [PATCH] Use first layer/profile from the set to pick up the material #5238 As currently we do not support multilayer/profile geometry and therefore we can't correctly represent them when they have multiple styles. As a workaround we'll use the material/style from the first layer and apply it to the entire object. --- src/bonsai/bonsai/tool/geometry.py | 1 + src/bonsai/bonsai/tool/loader.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index 2ab8d261e2..7eb851a5c2 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -582,6 +582,7 @@ class Geometry(bonsai.core.tool.Geometry): settings = ifcopenshell.geom.settings() settings.set("weld-vertices", True) settings.set("apply-default-materials", False) + settings.set("layerset-first", True) settings.set("keep-bounding-boxes", True) context = representation.ContextOfItems diff --git a/src/bonsai/bonsai/tool/loader.py b/src/bonsai/bonsai/tool/loader.py index 701ea6a83e..c10f1fde50 100644 --- a/src/bonsai/bonsai/tool/loader.py +++ b/src/bonsai/bonsai/tool/loader.py @@ -568,6 +568,7 @@ class Loader(bonsai.core.tool.Loader): settings.set("context-ids", [context.id()]) settings.set("apply-default-materials", False) settings.set("keep-bounding-boxes", True) + settings.set("layerset-first", True) if is_gross: settings.set("disable-opening-subtractions", True) results.append(settings)