From f139bbe3f1cee2be091380dd855b932573f0d2e3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Fri, 15 Sep 2017 16:05:24 +0200 Subject: [PATCH 1/9] Fixed some missed references to the previous variables - CURA-4232 --- cura/PrintInformation.py | 2 +- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 209d95d616..155d0a6d02 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -101,7 +101,7 @@ class PrintInformation(QObject): self._print_time_message_values = {} # Full fill message values using keys from _print_time_message_translations - for key in sorted(self._print_time_message_translations.keys()): + for key in self._print_time_message_translations.keys(): self._print_time_message_values[key] = Duration(None, self) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 09373d0c2f..a4859f6d7f 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -162,7 +162,7 @@ class SliceInfo(Extension): data["models"].append(model) - print_times = print_information.printTimesPerFeature + print_times = print_information._print_time_message_values data["print_times"] = {"travel": int(print_times["travel"].getDisplayString(DurationFormat.Format.Seconds)), "support": int(print_times["support"].getDisplayString(DurationFormat.Format.Seconds)), "infill": int(print_times["infill"].getDisplayString(DurationFormat.Format.Seconds)), From 37869a8b14c4505ac4f7d3bf61f20532d09fbe7d Mon Sep 17 00:00:00 2001 From: alekseisasin Date: Fri, 15 Sep 2017 16:36:00 +0200 Subject: [PATCH 2/9] Removed unused code. Shifted the last print quality number a bit to the left CURA-4182 --- resources/qml/SidebarSimple.qml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index bbfd8a424a..a219789c3c 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -349,23 +349,12 @@ Item } else if (i == total_tick_count - 1) { - start_x = current_start_x - offset * 2; + start_x = current_start_x - offset * 2.5; } ctx.fillText(resolutionSlider.model.getItem(i).layer_height_without_unit, start_x, text_top); current_start_x += step_size; } - - // print currently selected quality text - if (resolutionSlider.showQualityText && resolutionSlider.currentQualityIndex != undefine) - { - const text_top = parent.height / 2 + tick_height + tick_text_height * 2; - total_tick_count = resolutionSlider.totalTickCount; - const step_size = resolutionSlider.tickStepSize; - current_start_x = (tick_left_right_margin) + step_size * (resolutionSlider.currentQualityIndex - resolutionSlider.fullRangeMin); - ctx.fillStyle = UM.Theme.getColor("quality_slider_text"); - ctx.fillText(resolutionSlider.model.getItem(resolutionSlider.currentQualityIndex).name, current_start_x - 6, text_top); - } } MouseArea From 854c91550264b7d848564414a8731e7beb7f8604 Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 16:48:49 +0200 Subject: [PATCH 3/9] Tweaked margins and cleanup CURA-4182 --- resources/qml/SidebarSimple.qml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index bbfd8a424a..c4edb8de92 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -44,10 +44,8 @@ Item { id: resolutionLabel anchors.top: resolutionSlider.top - anchors.topMargin: UM.Theme.getSize("default_margin").height * 1.2 anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width - width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width text: catalog.i18nc("@label", "Layer Height") font: UM.Theme.getFont("default") @@ -57,10 +55,9 @@ Item Text { id: speedLabel - anchors.top: resolutionLabel.bottom + anchors.bottom: resolutionSlider.bottom anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width - anchors.topMargin: UM.Theme.getSize("default_margin").height * 1.5 text: catalog.i18nc("@label", "Print Speed") font: UM.Theme.getFont("default") @@ -70,7 +67,7 @@ Item Text { id: speedLabelSlower - anchors.top: speedLabel.top + anchors.bottom: speedLabel.bottom anchors.left: resolutionSlider.left text: catalog.i18nc("@label", "Slower") @@ -82,7 +79,7 @@ Item Text { id: speedLabelFaster - anchors.top: speedLabel.top + anchors.bottom: speedLabel.bottom anchors.right: resolutionSlider.right text: catalog.i18nc("@label", "Faster") @@ -95,11 +92,11 @@ Item { id: resolutionSlider anchors.top: parent.top - anchors.left: infillCellRight.left anchors.right: infillCellRight.right + width: UM.Theme.getSize("sidebar").width * .55 - height: UM.Theme.getSize("quality_slider_bar").height * 30 + height: UM.Theme.getSize("quality_slider_bar").height * 20 property var model: Cura.ProfilesModel From 74c24652e9824a659a6b67eb331bf35b007def0b Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 16:50:48 +0200 Subject: [PATCH 4/9] Revert "Tweak sidbar size so text is not cut off" This reverts commit b39fece86a3919aff0872137ad0b8315e6f42ac5. --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 8cec4d1d03..98626d3d45 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -289,7 +289,7 @@ "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], - "sidebar": [34.0, 10.0], + "sidebar": [32.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], "sidebar_header": [0.0, 4.0], From 2502038f76623bf8a81b9441c5308d97dbf2150f Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 Sep 2017 16:51:38 +0200 Subject: [PATCH 5/9] Revert "CURA-4321 make sidebar a tad smaller" This reverts commit 4aa8d38bd3f7b6582d6fac72d29d71e6a88aa8c6. --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 98626d3d45..8624760e3a 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -289,7 +289,7 @@ "extruder_button_material_margin": [0.70, 0.9], "extruder_button_material": [0.75, 0.75], - "sidebar": [32.0, 10.0], + "sidebar": [35.0, 10.0], "sidebar_margin": [1.71, 1.43], "sidebar_margin_thin": [0.71, 0.71], "sidebar_header": [0.0, 4.0], From 176fef8dbe5887d5091e8449c32fd2db9e755ac0 Mon Sep 17 00:00:00 2001 From: Taz8du29 <13140104+Taz8du29@users.noreply.github.com> Date: Sun, 17 Sep 2017 17:46:11 +0200 Subject: [PATCH 6/9] Minor formatting change in README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3fa497933..f8d809df16 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,11 @@ Dependencies Configuring Cura ---------------- -* Link your CuraEngine backend by inserting the following line in home/.config/cura/config.cfg : +Link your CuraEngine backend by inserting the following lines in `$HOME/.config/cura/config.cfg` : +``` [backend] location = /[path_to_the..]/CuraEngine/build/CuraEngine +``` Build scripts ------------- From 86e5a1ed974b3e18dffd7fb5745d7afe96021705 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 09:39:08 +0200 Subject: [PATCH 7/9] CURA-4182 tweak slider height to fix text cut off --- resources/qml/SidebarSimple.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index 20a00bca96..728501e5ef 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -96,7 +96,7 @@ Item anchors.right: infillCellRight.right width: UM.Theme.getSize("sidebar").width * .55 - height: UM.Theme.getSize("quality_slider_bar").height * 20 + height: UM.Theme.getSize("quality_slider_bar").height * 25 property var model: Cura.ProfilesModel From 4ca5987ca8fbf89cdf938c82dc6ff65e9ebc2942 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 10:50:52 +0200 Subject: [PATCH 8/9] CURA-4269 added a flag to determine wether auto drop should be executed or not --- cura/PlatformPhysics.py | 14 +++++++++----- plugins/3MFReader/ThreeMFReader.py | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index dc5594dc7b..3db681eb06 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -9,6 +9,7 @@ from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Math.Vector import Vector from UM.Scene.Selection import Selection from UM.Preferences import Preferences +from UM.Logger import Logger from cura.ConvexHullDecorator import ConvexHullDecorator @@ -41,10 +42,12 @@ class PlatformPhysics: def _onSceneChanged(self, source): self._change_timer.start() - def _onChangeTimerFinished(self): + def _onChangeTimerFinished(self, was_triggered_by_tool=False): if not self._enabled: return + Logger.log("d", "was_triggered_by_tool=%s", was_triggered_by_tool) + root = self._controller.getScene().getRoot() # Keep a list of nodes that are moving. We use this so that we don't move two intersecting objects in the @@ -71,14 +74,15 @@ class PlatformPhysics: # Check if this is the first time a project file node was loaded (disable auto drop in that case), defaults to True should_auto_drop = node.getSetting("auto_drop", True) + # This should NOT happen if the scene change was triggered by a tool (like translate), only on project load + if was_triggered_by_tool: + should_auto_drop = True + # If a node is grouped or it's loaded from a project file (auto-drop disabled), don't move it down if Preferences.getInstance().getValue("physics/automatic_drop_down") and not (node.getParent() and node.getParent().callDecoration("isGroup")) and node.isEnabled() and should_auto_drop: z_offset = node.callDecoration("getZOffset") if node.getDecorator(ZOffsetDecorator.ZOffsetDecorator) else 0 move_vector = move_vector.set(y=-bbox.bottom + z_offset) - # Enable auto-drop after processing the project file node for the first time - node.setSetting("auto_drop", False) - # If there is no convex hull for the node, start calculating it and continue. if not node.getDecorator(ConvexHullDecorator): node.addDecorator(ConvexHullDecorator()) @@ -167,4 +171,4 @@ class PlatformPhysics: node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) self._enabled = True - self._onChangeTimerFinished() + self._onChangeTimerFinished(True) diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 66dfb6130e..b947c4eb39 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -77,7 +77,10 @@ class ThreeMFReader(MeshReader): # \returns Uranium SceneNode. def _convertSavitarNodeToUMNode(self, savitar_node): um_node = SceneNode() - um_node.setSetting("auto_drop", False) # Disable the auto-drop feature when loading a project file and processing the nodes for the first time + + # Disable the auto-drop feature when loading a project file and processing the nodes for the first time + um_node.setSetting("auto_drop", False) + transformation = self._createMatrixFromTransformationString(savitar_node.getTransformation()) um_node.setTransformation(transformation) mesh_builder = MeshBuilder() From f07f7a2f1273267ea9c7855f79848fe6bc91adeb Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 18 Sep 2017 10:51:32 +0200 Subject: [PATCH 9/9] Remove logging --- cura/PlatformPhysics.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 3db681eb06..aca91f866a 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -9,7 +9,6 @@ from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Math.Vector import Vector from UM.Scene.Selection import Selection from UM.Preferences import Preferences -from UM.Logger import Logger from cura.ConvexHullDecorator import ConvexHullDecorator @@ -46,8 +45,6 @@ class PlatformPhysics: if not self._enabled: return - Logger.log("d", "was_triggered_by_tool=%s", was_triggered_by_tool) - root = self._controller.getScene().getRoot() # Keep a list of nodes that are moving. We use this so that we don't move two intersecting objects in the