From 41c96a032c3cf302db1401f2e1a8ab977dd315f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan=20Koral?= <45078678+oguzhankoral@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:32:58 +0300 Subject: [PATCH] Fix(rhino): Remove square brackets from material name (#198) --- .../HostApp/RhinoMaterialManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs index 1cface866..3a0e93780 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs @@ -90,6 +90,7 @@ public void BakeMaterials(List speckleRenderMaterialProxies // POC: Currently we're relying on the render material name for identification if it's coming from speckle and from which model; could we do something else? string materialId = speckleRenderMaterial.applicationId ?? speckleRenderMaterial.id; string matName = $"{speckleRenderMaterial.name}-({materialId})-{baseLayerName}"; + matName = matName.Replace("[", "").Replace("]", ""); // "Material" doesn't like square brackets if we create from here. Once they created from Rhino UI, all good.. Color diffuse = Color.FromArgb(speckleRenderMaterial.diffuse); Color emissive = Color.FromArgb(speckleRenderMaterial.emissive); double transparency = 1 - speckleRenderMaterial.opacity;