diff --git a/MatterControlLib/ApplicationView/PrinterModels.cs b/MatterControlLib/ApplicationView/PrinterModels.cs index 9286ee478..57d1c9bed 100644 --- a/MatterControlLib/ApplicationView/PrinterModels.cs +++ b/MatterControlLib/ApplicationView/PrinterModels.cs @@ -182,24 +182,13 @@ namespace MatterHackers.MatterControl itemsToAdd, context.View3DWidget, scene, + (Printer != null) ? Printer.Bed.BedCenter : Vector2.Zero, (item, itemsToAvoid) => { PlatingHelper.MoveToOpenPositionRelativeGroup(item, itemsToAvoid); })); }); - // Get the bounds of the loaded InsertionGroup with all of its content - //var aabb = injector.GetAxisAlignedBoundingBox(Matrix4X4.Identity); - - // Remove position - //injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(-aabb.minXYZ.X, -aabb.minXYZ.Y, -aabb.minXYZ.Z)); - - // Recenter - //injector.Matrix *= Matrix4X4.CreateTranslation(new Vector3(bedCenter.X - aabb.XSize / 2, (double)(bedCenter.Y - aabb.YSize / 2), 0)); - - // Move again after content loaded - //PlatingHelper.MoveToOpenPosition(injector, scene.Children.ToList()); - return insertionGroup; } diff --git a/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs b/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs index 34033794e..802f42f3a 100644 --- a/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs +++ b/MatterControlLib/Library/Widgets/InsertionGroupObject3D.cs @@ -62,6 +62,7 @@ namespace MatterHackers.MatterControl.Library public InsertionGroupObject3D(IEnumerable items, View3DWidget view3DWidget, InteractiveScene scene, + Vector2 newItemOffset, Action> layoutParts, bool trackSourceFiles = false) { @@ -78,7 +79,6 @@ namespace MatterHackers.MatterControl.Library this.LoadingItemsTask = Task.Run((Func)(async () => { - var newItemOffset = Vector2.Zero; var offset = Matrix4X4.Identity; // Add the placeholder 'Loading...' object diff --git a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs index c44dd9bae..5bdc1bf8f 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/View3DWidget.cs @@ -550,6 +550,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow items, this, Scene, + sceneContext.BedCenter, null, trackSourceFiles);