From 1c315baee42c4b5c98f73807afd432200ada14a2 Mon Sep 17 00:00:00 2001 From: kazooless Date: Fri, 10 Apr 2020 12:19:19 -0700 Subject: [PATCH 1/6] Add Ender-3 Pro without clip boundaries for magnetic bed --- .../definitions/creality_ender3pro.def.json | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 resources/definitions/creality_ender3pro.def.json diff --git a/resources/definitions/creality_ender3pro.def.json b/resources/definitions/creality_ender3pro.def.json new file mode 100644 index 0000000000..d2d538bc6e --- /dev/null +++ b/resources/definitions/creality_ender3pro.def.json @@ -0,0 +1,28 @@ +{ + "name": "Creality Ender-3 Pro", + "version": 2, + "inherits": "creality_base", + "metadata": { + "quality_definition": "creality_base", + "visible": true, + "platform": "creality_ender3.stl" + }, + "overrides": { + "machine_name": { "default_value": "Creality Ender-3 Pro" }, + "machine_width": { "default_value": 235 }, + "machine_depth": { "default_value": 235 }, + "machine_height": { "default_value": 250 }, + "machine_head_with_fans_polygon": { "default_value": [ + [-26, 34], + [-26, -32], + [32, -32], + [32, 34] + ] + }, + "machine_start_gcode": { + "default_value": "; Ender 3 Custom Start G-code\nG92 E0 ; Reset Extruder\nG28 ; Home all axes\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish" + }, + + "gantry_height": { "value": 25 } + } +} From 52f01a71c3cc54bbfb1f91b0531006dda7049450 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 14 Apr 2020 09:49:34 +0200 Subject: [PATCH 2/6] Use base_file to check if a material is known Fixes #7490 --- cura/Settings/MachineManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 36e6c2631f..0755fdfe4e 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -333,7 +333,7 @@ class MachineManager(QObject): self.setVariantByName(extruder.getMetaDataEntry("position"), machine_node.preferred_variant_name) variant_node = machine_node.variants.get(machine_node.preferred_variant_name) - material_node = variant_node.materials.get(extruder.material.getId()) + material_node = variant_node.materials.get(extruder.material.getMetaDataEntry("base_file")) if material_node is None: Logger.log("w", "An extruder has an unknown material, switching it to the preferred material") self.setMaterialById(extruder.getMetaDataEntry("position"), machine_node.preferred_material) From 214e41f9837730f2b537e1c703bd0ac23b6b653f Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Tue, 14 Apr 2020 16:55:36 +0200 Subject: [PATCH 3/6] Use a more specific link for the network troubleshooting guide CURA-7434 --- plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 59a0148550..e6bc464dea 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -173,7 +173,7 @@ Cura.MachineAction anchors.right: parent.right wrapMode: Text.WordWrap renderType: Text.NativeRendering - text: catalog.i18nc("@label", "If your printer is not listed, read the network printing troubleshooting guide").arg("https://ultimaker.com/en/troubleshooting"); + text: catalog.i18nc("@label", "If your printer is not listed, read the network printing troubleshooting guide").arg("https://support.ultimaker.com/hc/en-us/articles/360012795419"); onLinkActivated: Qt.openUrlExternally(link) } From f6479840f634582c741ca4afc67041edc73cde4d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 14 Apr 2020 17:59:00 +0200 Subject: [PATCH 4/6] Fix calculation of infill wipe distance starting from infill location Subtract the thickness of the walls from this setting. This most likely ends up negative and thus not counting because it's maxed with something that starts at 0. I've also simplified this algorithm a bit. Easier to follow if you ask me. Done as a 5 minute fix. --- cura/BuildVolume.py | 25 +++++++++++++++---------- cura/CuraApplication.py | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index ed79f43bf5..36edd427f7 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import numpy @@ -1086,14 +1086,19 @@ class BuildVolume(SceneNode): def _calculateMoveFromWallRadius(self, used_extruders): move_from_wall_radius = 0 # Moves that start from outer wall. - all_values = [move_from_wall_radius] - all_values.extend(self._getSettingFromAllExtruders("infill_wipe_dist")) - move_from_wall_radius = max(all_values) - avoid_enabled_per_extruder = [stack.getProperty("travel_avoid_other_parts", "value") for stack in used_extruders] - travel_avoid_distance_per_extruder = [stack.getProperty("travel_avoid_distance", "value") for stack in used_extruders] - for avoid_other_parts_enabled, avoid_distance in zip(avoid_enabled_per_extruder, travel_avoid_distance_per_extruder): # For each extruder (or just global). - if avoid_other_parts_enabled: - move_from_wall_radius = max(move_from_wall_radius, avoid_distance) + + for stack in used_extruders: + if stack.getProperty("travel_avoid_other_parts", "value"): + move_from_wall_radius = max(move_from_wall_radius, stack.getProperty("travel_avoid_distance", "value")) + + infill_wipe_distance = stack.getProperty("infill_wipe_dist", "value") + num_walls = stack.getProperty("wall_line_count", "value") + if num_walls >= 1: # Infill wipes start from the infill, so subtract the total wall thickness from this. + infill_wipe_distance -= stack.getProperty("wall_line_width_0", "value") + if num_walls >= 2: + infill_wipe_distance -= stack.getProperty("wall_line_width_x", "value") * (num_walls - 1) + move_from_wall_radius = max(move_from_wall_radius, infill_wipe_distance) + return move_from_wall_radius ## Calculate the disallowed radius around the edge. @@ -1133,7 +1138,7 @@ class BuildVolume(SceneNode): _prime_settings = ["extruder_prime_pos_x", "extruder_prime_pos_y", "prime_blob_enable"] _tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y", "prime_tower_brim_enable"] _ooze_shield_settings = ["ooze_shield_enabled", "ooze_shield_dist"] - _distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts", "travel_avoid_supports"] + _distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts", "travel_avoid_supports", "wall_line_count", "wall_line_width_0", "wall_line_width_x"] _extruder_settings = ["support_enable", "support_bottom_enable", "support_roof_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_bottom_extruder_nr", "support_roof_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. _limit_to_extruder_settings = ["wall_extruder_nr", "wall_0_extruder_nr", "wall_x_extruder_nr", "top_bottom_extruder_nr", "infill_extruder_nr", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_bottom_extruder_nr", "support_roof_extruder_nr", "adhesion_extruder_nr"] _disallowed_area_settings = _skirt_settings + _prime_settings + _tower_settings + _ooze_shield_settings + _distance_settings + _extruder_settings diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 00e4229f16..993bb15ae2 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1798,7 +1798,7 @@ class CuraApplication(QtApplication): # If a model is to small then it will not contain any points if offset_shape_arr is None and hull_shape_arr is None: Message(self._i18n_catalog.i18nc("@info:status", "The selected model was too small to load."), - title=self._i18n_catalog.i18nc("@info:title", "Warning")).show() + title = self._i18n_catalog.i18nc("@info:title", "Warning")).show() return # Step is for skipping tests to make it a lot faster. it also makes the outcome somewhat rougher From 3dbd154492c1544012ed704757120cbaf6af561b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 14 Apr 2020 17:59:00 +0200 Subject: [PATCH 5/6] Fix calculation of infill wipe distance starting from infill location Subtract the thickness of the walls from this setting. This most likely ends up negative and thus not counting because it's maxed with something that starts at 0. I've also simplified this algorithm a bit. Easier to follow if you ask me. Done as a 5 minute fix. --- cura/BuildVolume.py | 25 +++++++++++++++---------- cura/CuraApplication.py | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 9a268ac6d0..316e0fcb61 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import numpy @@ -1086,14 +1086,19 @@ class BuildVolume(SceneNode): def _calculateMoveFromWallRadius(self, used_extruders): move_from_wall_radius = 0 # Moves that start from outer wall. - all_values = [move_from_wall_radius] - all_values.extend(self._getSettingFromAllExtruders("infill_wipe_dist")) - move_from_wall_radius = max(all_values) - avoid_enabled_per_extruder = [stack.getProperty("travel_avoid_other_parts", "value") for stack in used_extruders] - travel_avoid_distance_per_extruder = [stack.getProperty("travel_avoid_distance", "value") for stack in used_extruders] - for avoid_other_parts_enabled, avoid_distance in zip(avoid_enabled_per_extruder, travel_avoid_distance_per_extruder): # For each extruder (or just global). - if avoid_other_parts_enabled: - move_from_wall_radius = max(move_from_wall_radius, avoid_distance) + + for stack in used_extruders: + if stack.getProperty("travel_avoid_other_parts", "value"): + move_from_wall_radius = max(move_from_wall_radius, stack.getProperty("travel_avoid_distance", "value")) + + infill_wipe_distance = stack.getProperty("infill_wipe_dist", "value") + num_walls = stack.getProperty("wall_line_count", "value") + if num_walls >= 1: # Infill wipes start from the infill, so subtract the total wall thickness from this. + infill_wipe_distance -= stack.getProperty("wall_line_width_0", "value") + if num_walls >= 2: + infill_wipe_distance -= stack.getProperty("wall_line_width_x", "value") * (num_walls - 1) + move_from_wall_radius = max(move_from_wall_radius, infill_wipe_distance) + return move_from_wall_radius ## Calculate the disallowed radius around the edge. @@ -1133,7 +1138,7 @@ class BuildVolume(SceneNode): _prime_settings = ["extruder_prime_pos_x", "extruder_prime_pos_y", "extruder_prime_pos_z", "prime_blob_enable"] _tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y", "prime_tower_brim_enable"] _ooze_shield_settings = ["ooze_shield_enabled", "ooze_shield_dist"] - _distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts", "travel_avoid_supports"] + _distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts", "travel_avoid_supports", "wall_line_count", "wall_line_width_0", "wall_line_width_x"] _extruder_settings = ["support_enable", "support_bottom_enable", "support_roof_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_bottom_extruder_nr", "support_roof_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. _limit_to_extruder_settings = ["wall_extruder_nr", "wall_0_extruder_nr", "wall_x_extruder_nr", "top_bottom_extruder_nr", "infill_extruder_nr", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_bottom_extruder_nr", "support_roof_extruder_nr", "adhesion_extruder_nr"] _disallowed_area_settings = _skirt_settings + _prime_settings + _tower_settings + _ooze_shield_settings + _distance_settings + _extruder_settings diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index e893e3d8f5..035baf2d20 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1774,7 +1774,7 @@ class CuraApplication(QtApplication): # If a model is to small then it will not contain any points if offset_shape_arr is None and hull_shape_arr is None: Message(self._i18n_catalog.i18nc("@info:status", "The selected model was too small to load."), - title=self._i18n_catalog.i18nc("@info:title", "Warning")).show() + title = self._i18n_catalog.i18nc("@info:title", "Warning")).show() return # Step is for skipping tests to make it a lot faster. it also makes the outcome somewhat rougher From 4050d3ccde1295ee5ce429638afe849a32381296 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 14 Apr 2020 18:37:22 +0200 Subject: [PATCH 6/6] Prevent crash when a setting is not in any setting category I don't know what exactly caused this since it's impossible to trace. But the crash happened with a setting called 'dual_gcode' which currently doesn't exist in Cura. So I think it must be some plug-in that adds it. In any case, it's good to be defensive about this sort of thing. Good type checking would've caught this for us. Fixes Sentry issue CURA-JB. --- cura/Machines/Models/UserChangesModel.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cura/Machines/Models/UserChangesModel.py b/cura/Machines/Models/UserChangesModel.py index ec623f0f38..43bbe8a663 100644 --- a/cura/Machines/Models/UserChangesModel.py +++ b/cura/Machines/Models/UserChangesModel.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os @@ -7,6 +7,7 @@ from collections import OrderedDict from PyQt5.QtCore import pyqtSlot, Qt from UM.Application import Application +from UM.Logger import Logger from UM.Settings.ContainerRegistry import ContainerRegistry from UM.i18n import i18nCatalog from UM.Settings.SettingFunction import SettingFunction @@ -83,14 +84,18 @@ class UserChangesModel(ListModel): # Find the category of the instance by moving up until we find a category. category = user_changes.getInstance(setting_key).definition - while category.type != "category": + while category is not None and category.type != "category": category = category.parent # Handle translation (and fallback if we weren't able to find any translation files. - if self._i18n_catalog: - category_label = self._i18n_catalog.i18nc(category.key + " label", category.label) - else: - category_label = category.label + if category is not None: + if self._i18n_catalog: + category_label = self._i18n_catalog.i18nc(category.key + " label", category.label) + else: + category_label = category.label + else: # Setting is not in any category. Shouldn't happen, but it do. See https://sentry.io/share/issue/d735884370154166bc846904d9b812ff/ + Logger.error("Setting {key} is not in any setting category.".format(key = setting_key)) + category_label = "" if self._i18n_catalog: label = self._i18n_catalog.i18nc(setting_key + " label", stack.getProperty(setting_key, "label"))