Skip to content

Commit d0d1f68

Browse files
authored
Do not store group id in baked object ids (#185)
1 parent e370090 commit d0d1f68

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private void HighlightObjectsOnView(IReadOnlyList<RhinoObject> rhinoObjects, IRe
124124
RhinoDoc.ActiveDoc.Objects.UnselectAll();
125125
List<RhinoObject> rhinoObjectsToSelect = new(rhinoObjects);
126126

127-
foreach (Group group in groups)
127+
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.
128128
{
129129
int groupIndex = RhinoDoc.ActiveDoc.Groups.Find(group.Name);
130130
if (groupIndex < 0)

Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ private HostObjectBuilderResult BakeObjects(
205205
}
206206

207207
// 4: log
208-
var id = conversionIds[0];
208+
var id = conversionIds[0]; // this is group id if it is a one to many conversion, otherwise id of object itself
209209
conversionResults.Add(new(Status.SUCCESS, obj, id, result.GetType().ToString()));
210-
bakedObjectIds.Add(id);
210+
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.
211211

212212
// 5: populate app id map
213213
applicationIdMap[obj.applicationId ?? obj.id] = conversionIds;

0 commit comments

Comments
 (0)