From 6fb4081efda464341b41d00a8ac577efe04d862b Mon Sep 17 00:00:00 2001 From: Claire Kuang Date: Fri, 9 Aug 2024 13:50:40 +0200 Subject: [PATCH] fix(rhino): CNX-245 render materials inherited from layer bug (#127) --- .../Operations/Receive/RhinoHostObjectBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs index 888de756a..66c23e958 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs @@ -178,9 +178,9 @@ public class RhinoHostObjectBuilder : IHostObjectBuilder var objectId = obj.applicationId ?? obj.id; // POC: assuming objects have app ids for this to work? // 3: colors and materials - var matIndex = _materialManager.ObjectIdAndMaterialIndexMap.TryGetValue(objectId, out int mIndex) + int? matIndex = _materialManager.ObjectIdAndMaterialIndexMap.TryGetValue(objectId, out int mIndex) ? mIndex - : 0; + : null; Color? objColor = _colorManager.ObjectColorsIdMap.TryGetValue(objectId, out Color color) ? color : null; // 4: actually bake