From f04dc88d2c1c1feb5d9ed715ab13fb1a3a47ff2c Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 15 Dec 2016 15:36:38 +0100 Subject: [PATCH 1/6] Do not use resolve for profile display when source is quality changes Fixes CURA-3115 --- cura/Settings/QualitySettingsModel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Settings/QualitySettingsModel.py b/cura/Settings/QualitySettingsModel.py index 46d829d06f..e6499ae8d0 100644 --- a/cura/Settings/QualitySettingsModel.py +++ b/cura/Settings/QualitySettingsModel.py @@ -193,6 +193,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): profile_value_source = "" for container in containers: new_value = container.getProperty(definition.key, "value") + if new_value is not None: profile_value_source = container.getMetaDataEntry("type") profile_value = new_value @@ -200,7 +201,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel): # Global tab should use resolve (if there is one) if not self._extruder_id: resolve_value = global_container_stack.getProperty(definition.key, "resolve") - if resolve_value is not None and profile_value is not None: + if resolve_value is not None and profile_value is not None and profile_value_source != "quality_changes": profile_value = resolve_value user_value = None From 04692d109366d715914fea50f9e7cd98309576cb Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 15 Dec 2016 16:16:50 +0100 Subject: [PATCH 2/6] Ignore polygons with length 0 when updating disallowed areas Contributes to CURA-3148 --- cura/BuildVolume.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index b6c5b7cf02..629f7ba6d8 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -285,6 +285,9 @@ class BuildVolume(SceneNode): color = Color(0.0, 0.0, 0.0, 0.15) for polygon in self._disallowed_areas: points = polygon.getPoints() + if len(points) == 0: + continue + first = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d)) previous_point = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d)) for point in points: @@ -827,4 +830,4 @@ class BuildVolume(SceneNode): _tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y"] _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"] - _extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. \ No newline at end of file + _extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. From c7a8ffb3c02b1001a7743efc5da30d7ef84aa7c9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 15 Dec 2016 16:41:38 +0100 Subject: [PATCH 3/6] Set quality to empty if no profiles for current material type This then causes the text 'Not supported' to appear to the user, indicating that for his foreign material we have no known quality profiles. Contributes to issue CURA-3144. --- cura/Settings/MachineManager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index c20da335e0..11a8087f37 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -815,6 +815,8 @@ class MachineManager(QObject): for stack in stacks: material = stack.findContainer(type="material") quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material]) + if not quality: #No quality profile is found for this quality type. + quality = self._empty_quality_container result.append({"stack": stack, "quality": quality, "quality_changes": empty_quality_changes}) if extruder_stacks: @@ -868,6 +870,8 @@ class MachineManager(QObject): material = stack.findContainer(type="material") quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material]) + if not quality: #No quality profile found for this quality type. + quality = self._empty_quality_container result.append({"stack": stack, "quality": quality, "quality_changes": quality_changes}) From 2e894477c830e3b18aa6b8c19efbc074e667e8a1 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 15 Dec 2016 16:45:28 +0100 Subject: [PATCH 4/6] Make Debug mode a build-time option instead of a hardcoded value --- CMakeLists.txt | 1 + cura/CrashHandler.py | 10 ++++++---- cura/CuraVersion.py.in | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 002662152e..ab08a4d624 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY add_custom_target(tests) add_custom_command(TARGET tests POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DIR}/../Uranium/:${CMAKE_SOURCE_DIR}" ${PYTHON_EXECUTABLE} -m pytest -r a --junitxml=${CMAKE_BINARY_DIR}/junit.xml ${CMAKE_SOURCE_DIR} || exit 0) +option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF) set(CURA_VERSION "master" CACHE STRING "Version name of Cura") set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'") diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 94b1971bdf..ba8499d4f2 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -12,6 +12,11 @@ from UM.Logger import Logger from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") +try: + from cura.CuraVersion import CuraDebugMode +except ImportError: + CuraDebugMode = False # [CodeStyle: Reflecting imported value] + # List of exceptions that should be considered "fatal" and abort the program. # These are primarily some exception types that we simply cannot really recover from # (MemoryError and SystemError) and exceptions that indicate grave errors in the @@ -24,21 +29,18 @@ fatal_exception_types = [ ] def show(exception_type, value, tb): - debug_mode = True - Logger.log("c", "An uncaught exception has occurred!") for line in traceback.format_exception(exception_type, value, tb): for part in line.rstrip("\n").split("\n"): Logger.log("c", part) - if not debug_mode and exception_type not in fatal_exception_types: + if not CuraDebugMode and exception_type not in fatal_exception_types: return application = QCoreApplication.instance() if not application: sys.exit(1) - dialog = QDialog() dialog.setMinimumWidth(640) dialog.setMinimumHeight(640) diff --git a/cura/CuraVersion.py.in b/cura/CuraVersion.py.in index 5ad819b1fc..8a4d13e526 100644 --- a/cura/CuraVersion.py.in +++ b/cura/CuraVersion.py.in @@ -2,4 +2,5 @@ # Cura is released under the terms of the AGPLv3 or higher. CuraVersion = "@CURA_VERSION@" -CuraBuildType = "@CURA_BUILDTYPE@" \ No newline at end of file +CuraBuildType = "@CURA_BUILDTYPE@" +CuraDebugMode = True if "@CURA_DEBUGMODE@" == "ON" else False From 6baff7bbb29001be11668d7fe1aeccc61c12f221 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 15 Dec 2016 17:18:08 +0100 Subject: [PATCH 5/6] Fixed create profile from settings not working --- resources/qml/Cura.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index e78786c7a3..314f3b7443 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -533,9 +533,9 @@ UM.MainWindow target: Cura.Actions.addProfile onTriggered: { - preferences.setPage(4); - preferences.show(); + preferences.show(); + preferences.setPage(4); // Create a new profile after a very short delay so the preference page has time to initiate createProfileTimer.start(); } From 8676f3db404b7c815fae79bdb96b27497ff90af8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 16 Dec 2016 09:36:40 +0100 Subject: [PATCH 6/6] Added workaround for curaproject.3mf extensions not being handled on osx CURA-3130 --- plugins/3MFReader/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/3MFReader/__init__.py b/plugins/3MFReader/__init__.py index 617bdd594c..3e05cb8dc7 100644 --- a/plugins/3MFReader/__init__.py +++ b/plugins/3MFReader/__init__.py @@ -4,10 +4,16 @@ from . import ThreeMFReader from . import ThreeMFWorkspaceReader from UM.i18n import i18nCatalog +import UM.Platform catalog = i18nCatalog("cura") def getMetaData(): + # Workarround for osx not supporting double file extensions correclty. + if UM.Platform.isOSX(): + workspace_extension = "3mf" + else: + workspace_extension = "curaproject.3mf" return { "plugin": { "name": catalog.i18nc("@label", "3MF Reader"), @@ -25,7 +31,7 @@ def getMetaData(): "workspace_reader": [ { - "extension": "curaproject.3mf", + "extension": workspace_extension, "description": catalog.i18nc("@item:inlistbox", "3MF File") } ]