Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes instance receiving in some edge cases #418

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ CancellationToken cancellationToken
PreReceiveDeepClean(baseLayerName);

// 1 - Unpack objects and proxies from root commit object

var unpackedRoot = _rootObjectUnpacker.Unpack(rootObject);

// 2 - Split atomic objects and instance components with their path
var (atomicObjects, instanceComponents) = _rootObjectUnpacker.SplitAtomicObjectsAndInstances(
unpackedRoot.ObjectsToConvert
var (atomicObjectsWithoutInstanceComponentsForConverter, instanceComponents) =
_rootObjectUnpacker.SplitAtomicObjectsAndInstances(unpackedRoot.ObjectsToConvert);

var atomicObjectsWithoutInstanceComponentsWithPath = _layerBaker.GetAtomicObjectsWithPath(
atomicObjectsWithoutInstanceComponentsForConverter
);
var atomicObjectsWithPath = _layerBaker.GetAtomicObjectsWithPath(atomicObjects);
var instanceComponentsWithPath = _layerBaker.GetInstanceComponentsWithPath(instanceComponents);

// 2.1 - these are not captured by traversal, so we need to re-add them here
Expand Down Expand Up @@ -112,7 +113,9 @@ CancellationToken cancellationToken
RhinoApp.InvokeAndWait(() =>
{
using var layerNoDraw = new DisableRedrawScope(_converterSettings.Current.Document.Views);
_layerBaker.CreateAllLayersForReceive(atomicObjectsWithPath.Select(t => t.path), baseLayerName);
var paths = atomicObjectsWithoutInstanceComponentsWithPath.Select(t => t.path).ToList();
paths.AddRange(instanceComponentsWithPath.Select(t => t.path));
_layerBaker.CreateAllLayersForReceive(paths, baseLayerName);
});
}

Expand All @@ -124,11 +127,13 @@ CancellationToken cancellationToken
int count = 0;
using (var _ = _activityFactory.Start("Converting objects"))
{
foreach (var (path, obj) in atomicObjectsWithPath)
foreach (var (path, obj) in atomicObjectsWithoutInstanceComponentsWithPath)
{
using (var convertActivity = _activityFactory.Start("Converting object"))
{
onOperationProgressed.Report(new("Converting objects", (double)++count / atomicObjects.Count));
onOperationProgressed.Report(
new("Converting objects", (double)++count / atomicObjectsWithoutInstanceComponentsForConverter.Count)
);
try
{
// 0: get pre-created layer from cache in layer baker
Expand Down
Loading