From ee492b91572a34fa050e9c60f5a5de363cbb107d Mon Sep 17 00:00:00 2001 From: oguzhankoral Date: Wed, 21 Aug 2024 20:32:47 +0300 Subject: [PATCH] Do not store group id in baked object ids --- .../Bindings/RhinoBasicConnectorBinding.cs | 2 +- .../Operations/Receive/RhinoHostObjectBuilder.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs index e72d45472..df990fa46 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs @@ -124,7 +124,7 @@ private void HighlightObjectsOnView(IReadOnlyList rhinoObjects, IRe RhinoDoc.ActiveDoc.Objects.UnselectAll(); List rhinoObjectsToSelect = new(rhinoObjects); - foreach (Group group in groups) + foreach (Group group in groups) // This is not performant if we have many groups. That's why we do not store group ids on baked object ids, to not have a problem later on highlighting all model. Mostly for single group highlight from report item. { int groupIndex = RhinoDoc.ActiveDoc.Groups.Find(group.Name); if (groupIndex < 0) diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs index 11f31aec6..a888e83ff 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs @@ -205,9 +205,9 @@ private HostObjectBuilderResult BakeObjects( } // 4: log - var id = conversionIds[0]; + var id = conversionIds[0]; // this is group id if it is a one to many conversion, otherwise id of object itself conversionResults.Add(new(Status.SUCCESS, obj, id, result.GetType().ToString())); - bakedObjectIds.Add(id); + bakedObjectIds.AddRange(conversionIds.Skip(1)); // first item always a group id, which we do not want to deal with later groups and its sub elements. It causes a huge issue on performance. // 5: populate app id map applicationIdMap[obj.applicationId ?? obj.id] = conversionIds;