From c94159d196f58a47d668a7862727111c38816dc9 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 27 May 2022 15:16:44 -0700 Subject: [PATCH 1/3] Make clearing the solid color also clear the output type --- MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs | 4 ++-- .../PartPreviewWindow/View3D/UndoCommands/ChangeColor.cs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs b/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs index f0643c9c1..ad20ce147 100644 --- a/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs +++ b/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs @@ -302,7 +302,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (selectedItem.Color != colorField.Color) { - undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color)); + undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color, PrintOutputTypes.Default)); } }; @@ -384,7 +384,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var currentOutputType = selectedItem.OutputType; if (currentOutputType != PrintOutputTypes.Solid && currentOutputType != PrintOutputTypes.Default) { - undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color)); + undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color, PrintOutputTypes.Solid)); } SetButtonStates(); diff --git a/MatterControlLib/PartPreviewWindow/View3D/UndoCommands/ChangeColor.cs b/MatterControlLib/PartPreviewWindow/View3D/UndoCommands/ChangeColor.cs index 09547b1f2..dac3ca58c 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/UndoCommands/ChangeColor.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/UndoCommands/ChangeColor.cs @@ -41,10 +41,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow private List itemsColor = new List(); private List itemsToChange = new List(); private Color color; + private PrintOutputTypes outputTypeToSet; - public ChangeColor(IObject3D selectedItem, Color color) + public ChangeColor(IObject3D selectedItem, Color color, PrintOutputTypes outputType) { this.color = color; + this.outputTypeToSet = outputType; if (selectedItem is SelectionGroupObject3D) { SetData(selectedItem.Children.ToList()); @@ -69,7 +71,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { foreach(var item in this.itemsToChange) { - item.OutputType = PrintOutputTypes.Solid; + item.OutputType = outputTypeToSet; item.Color = color; } } From 90cf1f183b3f8eb720071bd6d92a06f7e1fbbd02 Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Fri, 27 May 2022 17:44:03 -0700 Subject: [PATCH 2/3] Working to make output type be clearable --- .../PartPreviewWindow/SelectedObjectPanel.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs b/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs index ad20ce147..ca0025b04 100644 --- a/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs +++ b/MatterControlLib/PartPreviewWindow/SelectedObjectPanel.cs @@ -302,7 +302,14 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { if (selectedItem.Color != colorField.Color) { - undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color, PrintOutputTypes.Default)); + if (colorField.Color == Color.Transparent) + { + undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color, PrintOutputTypes.Default)); + } + else + { + undoBuffer.AddAndDo(new ChangeColor(selectedItem, colorField.Color, PrintOutputTypes.Solid)); + } } }; From 9d18cb20e0235d774a3930bf9cf6774cdea13acd Mon Sep 17 00:00:00 2001 From: LarsBrubaker Date: Mon, 30 May 2022 07:08:34 -0700 Subject: [PATCH 3/3] Don't apply holes to support --- .../SlicerConfiguration/EngineMappingsMatterSlice.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MatterControlLib/SlicerConfiguration/EngineMappingsMatterSlice.cs b/MatterControlLib/SlicerConfiguration/EngineMappingsMatterSlice.cs index 0e6c10543..599f5835a 100644 --- a/MatterControlLib/SlicerConfiguration/EngineMappingsMatterSlice.cs +++ b/MatterControlLib/SlicerConfiguration/EngineMappingsMatterSlice.cs @@ -324,7 +324,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration if (supportObjects.Any()) { // add a flag to the merge rules to let us know there was support - mergeRules += "S" + AddObjectsForExtruder(supportObjects, holes, outputOptions, ref savedStlCount); + mergeRules += "S" + AddObjectsForExtruder(supportObjects, null, outputOptions, ref savedStlCount); } var wipeTowerObjects = meshItemsOnBuildPlate.Where((item) => item.WorldOutputType() == PrintOutputTypes.WipeTower); @@ -639,7 +639,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration } } - if (holes.Any()) + if (holes?.Any() == true) { bool firstHole = true;