From 5c8a47275ec37081e512d832c2655dff09482ca1 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 22 Jan 2018 13:08:30 +0100 Subject: [PATCH 1/5] CURA-4845 Revert changes when accessing the quality changes at the time of creating the global ProfileTab in the preferences. --- resources/qml/Preferences/ProfilesPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 5e040cdba2..e3ba9b23a4 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -213,8 +213,8 @@ UM.ManagementPage ProfileTab { title: catalog.i18nc("@title:tab", "Global Settings"); - quality: Cura.MachineManager.activeMachine.qualityChanges.id - material: Cura.MachineManager.activeMachine.material.id + quality: base.currentItem != null ? base.currentItem.id : ""; + material: Cura.MachineManager.allActiveMaterialIds[Cura.MachineManager.activeMachineId] } Repeater From 20da35ec5cd3fde90a2fcd569f05267db91ee97e Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 22 Jan 2018 13:12:22 +0100 Subject: [PATCH 2/5] Check when the containers are empty instead of None. Contributes to CURA-4845 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 3eca1326d0..638971d109 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -928,9 +928,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # sanity checks # NOTE: The following cases SHOULD NOT happen!!!! - if not old_container: + if old_container.getId() in ("empty_quality_changes", "empty_definition_changes", "empty"): Logger.log("e", "We try to get [%s] from the global stack [%s] but we got None instead!", changes_container_type, global_stack.getId()) + continue # Replace the quality/definition changes container if it's in the GlobalStack # NOTE: we can get an empty container here, but the IDs will not match, @@ -954,9 +955,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # sanity checks # NOTE: The following cases SHOULD NOT happen!!!! - if not changes_container: + if changes_container.getId() in ("empty_quality_changes", "empty_definition_changes", "empty"): Logger.log("e", "We try to get [%s] from the extruder stack [%s] but we got None instead!", changes_container_type, each_extruder_stack.getId()) + continue # NOTE: we can get an empty container here, but the IDs will not match, # so this comparison is fine. From e2bc14cc589c96161d75d3a851e1502a9d81a905 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Sun, 21 Jan 2018 17:16:18 +0100 Subject: [PATCH 3/5] Change layer thickness colormap to parula-like (https://es.mathworks.com/help/matlab/ref/parula.html) --- plugins/SimulationView/SimulationView.qml | 12 ++++++------ plugins/SimulationView/layers3d.shader | 10 +++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/SimulationView/SimulationView.qml b/plugins/SimulationView/SimulationView.qml index 11b985f77c..db92fac798 100644 --- a/plugins/SimulationView/SimulationView.qml +++ b/plugins/SimulationView/SimulationView.qml @@ -485,7 +485,7 @@ Item } } - // Gradient colors for layer thickness + // Gradient colors for layer thickness (similar to parula colormap) Rectangle { // In QML 5.9 can be changed by LinearGradient // Invert values because then the bar is rotated 90 degrees id: thicknessGradient @@ -499,23 +499,23 @@ Item gradient: Gradient { GradientStop { position: 0.000 - color: Qt.rgba(1, 0, 0, 1) + color: Qt.rgba(1, 1, 0, 1) } GradientStop { position: 0.25 - color: Qt.rgba(0.5, 0.5, 0, 1) + color: Qt.rgba(1, 0.75, 0.25, 1) } GradientStop { position: 0.5 - color: Qt.rgba(0, 1, 0, 1) + color: Qt.rgba(0, 0.75, 0.5, 1) } GradientStop { position: 0.75 - color: Qt.rgba(0, 0.5, 0.5, 1) + color: Qt.rgba(0, 0.375, 0.75, 1) } GradientStop { position: 1.0 - color: Qt.rgba(0, 0, 1, 1) + color: Qt.rgba(0, 0, 0.5, 1) } } } diff --git a/plugins/SimulationView/layers3d.shader b/plugins/SimulationView/layers3d.shader index 95dc604389..03e279e9eb 100644 --- a/plugins/SimulationView/layers3d.shader +++ b/plugins/SimulationView/layers3d.shader @@ -54,9 +54,13 @@ vertex41core = vec4 layerThicknessGradientColor(float abs_value, float min_value, float max_value) { float value = (abs_value - min_value)/(max_value - min_value); - float red = max(2*value-1, 0); - float green = 1-abs(1-2*value); - float blue = max(1-2*value, 0); + float red = min(max(4*value-2, 0), 1); + float green = min(1.5*value, 0.75); + if (value > 0.75) + { + green = value; + } + float blue = 0.75-abs(0.25-value); return vec4(red, green, blue, 1.0); } From 20ab6265c8d4cbc83230b6f57f4595a423355bcf Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 22 Jan 2018 13:58:35 +0100 Subject: [PATCH 4/5] CURA-4821 Delete also the GCode SceneNode when clearing the buildplate --- cura/CuraApplication.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 7b6e970a68..26f9516a89 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1055,7 +1055,7 @@ class CuraApplication(QtApplication): continue # Node that doesnt have a mesh and is not a group. if only_selectable and not node.isSelectable(): continue - if not node.callDecoration("isSliceable"): + if not node.callDecoration("isSliceable") and not node.callDecoration("getLayerData"): continue # Only remove nodes that are selectable. if node.getParent() and node.getParent().callDecoration("isGroup"): continue # Grouped nodes don't need resetting as their parent (the group) is resetted) @@ -1071,10 +1071,6 @@ class CuraApplication(QtApplication): # Reset the print information: self.getController().getScene().sceneChanged.emit(node) - # self._print_information.setToZeroPrintInformation(self.getBuildPlateModel().activeBuildPlate) - - # stay on the same build plate - #self.getCuraSceneController().setActiveBuildPlate(0) # Select first build plate ## Reset all translation on nodes with mesh data. @pyqtSlot() From 50ccf101d83fab1a3530c0393fcbf6bd0980d3c8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 22 Jan 2018 15:37:51 +0100 Subject: [PATCH 5/5] Don't write Octoprint keys to workspace projects They should not be shared since they are private keys, so let's protect the user from accidentally sharing it via a project file. --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index f07a37a25f..825259ad58 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -97,7 +97,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): file_in_archive.compress_type = zipfile.ZIP_DEFLATED # Do not include the network authentication keys - ignore_keys = {"network_authentication_id", "network_authentication_key"} + ignore_keys = {"network_authentication_id", "network_authentication_key", "octoprint_api_key"} serialized_data = container.serialize(ignored_metadata_keys = ignore_keys) archive.writestr(file_in_archive, serialized_data)