From 73ca50d958d08c5127fff97f3e75f414ca5cf2c4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 9 Nov 2021 10:17:32 +0100 Subject: [PATCH 1/4] Handle exception when adhesion extruder could not be found This should be pretty rare; the crash would only happen due to a race condition cura-8584 --- cura/BuildVolume.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 72e7d539ced..8374bddf748 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -6,6 +6,7 @@ from typing import List, Optional, TYPE_CHECKING, Any, Set, cast, Iterable, Dict +from UM.Logger import Logger from UM.Mesh.MeshData import MeshData from UM.Mesh.MeshBuilder import MeshBuilder @@ -1078,7 +1079,11 @@ def _calculateBedAdhesionSize(self, used_extruders, adhesion_override = None): # setting does *not* have a limit_to_extruder setting (which means that we can't ask the global extruder what # the value is. adhesion_extruder = self._global_container_stack.getProperty("adhesion_extruder_nr", "value") - adhesion_stack = self._global_container_stack.extruderList[int(adhesion_extruder)] + try: + adhesion_stack = self._global_container_stack.extruderList[int(adhesion_extruder)] + except IndexError: + Logger.warning(f"Couldn't find extruder with index '{adhesion_extruder}', defaulting to 0 instead.") + adhesion_stack = self._global_container_stack.extruderList[0] skirt_brim_line_width = adhesion_stack.getProperty("skirt_brim_line_width", "value") initial_layer_line_width_factor = adhesion_stack.getProperty("initial_layer_line_width_factor", "value") From ca942a15e8dd2333b94330b25a4d603b98b612c5 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 9 Nov 2021 14:45:40 +0100 Subject: [PATCH 2/4] Don't use infinite lifetimes lightly This is very annoying if switching profiles. This is not a critical message. The message should disappear after the default amount of time. Discovered while working on CURA-8584. --- cura/Settings/MachineManager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index b172d92d006..6d6c78cb1b2 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -855,7 +855,6 @@ def correctExtruderSettings(self) -> None: caution_message = Message( catalog.i18nc("@info:message Followed by a list of settings.", "Settings have been changed to match the current availability of extruders:") + " [{settings_list}]".format(settings_list = ", ".join(add_user_changes)), - lifetime = 0, title = catalog.i18nc("@info:title", "Settings updated")) caution_message.show() From c1a839ccaa7c252879ce22c72867e70582b0bba2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 9 Nov 2021 15:10:09 +0100 Subject: [PATCH 3/4] Also ensure that extruder settings are correct when discarding unsaved changes CURA-8584 --- cura/CuraApplication.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 337797ecf62..dbca0b7e96f 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -717,6 +717,7 @@ def discardOrKeepProfileChangesClosed(self, option: str) -> None: for extruder in global_stack.extruderList: extruder.userChanges.clear() global_stack.userChanges.clear() + self.getMachineManager().correctExtruderSettings() # if the user decided to keep settings then the user settings should be re-calculated and validated for errors # before slicing. To ensure that slicer uses right settings values From 61d78955881d0fe55bbbad7ad192b90dcba5dc16 Mon Sep 17 00:00:00 2001 From: luz paz Date: Tue, 9 Nov 2021 10:38:01 -0500 Subject: [PATCH 4/4] Fix typos Found via `codespell -q 3 -S *.po,*.pot -L childs,initialy,lod,ned,te,slicable,sur,tutoriels,wont` --- resources/definitions/creality_ender6.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/creality_ender6.def.json b/resources/definitions/creality_ender6.def.json index 7d1c8ff9f4f..56ceab88b2a 100644 --- a/resources/definitions/creality_ender6.def.json +++ b/resources/definitions/creality_ender6.def.json @@ -5,7 +5,7 @@ "overrides": { "machine_name": { "default_value": "Creality Ender-6" }, "machine_start_gcode": { "default_value": "\nG28 ;Home\n\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nG1 X10.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line\nG1 X10.4 Y200.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E30 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\n"}, - "machine_end_gcode": { "default_value": "G91 ;Relative positionning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positionning\n\nG28 X Y ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, + "machine_end_gcode": { "default_value": "G91 ;Relative positioning\nG1 E-2 F2700 ;Retract a bit\nG1 E-2 Z0.2 F2400 ;Retract and raise Z\nG1 X5 Y5 F3000 ;Wipe out\nG1 Z10 ;Raise Z more\nG90 ;Absolute positioning\n\nG28 X Y ;Present print\nM106 S0 ;Turn-off fan\nM104 S0 ;Turn-off hotend\nM140 S0 ;Turn-off bed\n\nM84 X Y E ;Disable all steppers but Z\n" }, "machine_width": { "default_value": 260 }, "machine_depth": { "default_value": 260 }, "machine_height": { "default_value": 400 },