diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 890e73ae6..4ce548304 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -753,19 +753,46 @@ namespace MatterHackers.MatterControl Icon = (invertIcon) => AggContext.StaticData.LoadIcon("remove.png").SetPreMultiply(), }, new SceneSelectionSeparator(), - new SceneSelectionOperation() + new OperationGroup() { - OperationType = typeof(AlignObject3D), - TitleResolver = () => "Align".Localize(), - Action = (sceneContext) => - { - var scene = sceneContext.Scene; - var selectedItem = scene.SelectedItem; - var align = new AlignObject3D(); - align.AddSelectionAsChildren(scene, selectedItem); - }, - Icon = (invertIcon) => AggContext.StaticData.LoadIcon("align_left_dark.png", 16, 16, invertIcon).SetPreMultiply(), IsEnabled = (scene) => scene.SelectedItem is SelectionGroupObject3D, + Operations = new List() + { + new SceneSelectionOperation() + { + OperationType = typeof(AlignObject3D), + TitleResolver = () => "Align".Localize(), + Action = (sceneContext) => + { + var scene = sceneContext.Scene; + var selectedItem = scene.SelectedItem; + var align = new AlignObject3D(); + align.AddSelectionAsChildren(scene, selectedItem); + }, + Icon = (invertIcon) => AggContext.StaticData.LoadIcon("align_left_dark.png", 16, 16, invertIcon).SetPreMultiply(), + IsEnabled = (scene) => scene.SelectedItem is SelectionGroupObject3D, + }, + new SceneSelectionOperation() + { + OperationType = typeof(AlignObject3D), + TitleResolver = () => "Dual Extrusion Align".Localize(), + HelpTextResolver = () => "Reset parts to modeled positions".Localize(), + Action = (sceneContext) => + { + var scene = sceneContext.Scene; + var selectedItem = scene.SelectedItem; + + if (selectedItem is SelectionGroupObject3D selectionGroup) + { + foreach (var child in selectionGroup.Children) + { + child.Matrix = Matrix4X4.Identity; + } + } + }, + IsEnabled = (scene) => scene.SelectedItem is SelectionGroupObject3D, + } + } }, new SceneSelectionOperation() { diff --git a/MatterControlLib/PartPreviewWindow/ViewControls3D.cs b/MatterControlLib/PartPreviewWindow/ViewControls3D.cs index da8a56c99..a85789d58 100644 --- a/MatterControlLib/PartPreviewWindow/ViewControls3D.cs +++ b/MatterControlLib/PartPreviewWindow/ViewControls3D.cs @@ -518,7 +518,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow else if (namedAction.Icon != null) { // add the create support before the align - if (namedAction.OperationType == typeof(AlignObject3D)) + if (namedAction is SceneSelectionOperation selectionOperation + && selectionOperation.OperationType == typeof(AlignObject3D)) { this.AddChild(CreateWipeTowerButton(theme)); this.AddChild(CreateSupportButton(theme));