From 7302d979dc4358d254ae0db72a582e464caf7997 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 3 Jun 2015 17:04:29 +0200 Subject: [PATCH 1/8] Use the right offset for object collision after Polygon collision was fixed Contributes to #35 --- cura/PlatformPhysics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 8ddf206aea..c52e8a9174 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -80,8 +80,8 @@ class PlatformPhysics: if overlap is None: continue - move_vector.setX(-overlap[0]) - move_vector.setZ(-overlap[1]) + move_vector.setX(overlap[0] * 1.1) + move_vector.setZ(overlap[1] * 1.1) if move_vector != Vector(): op = PlatformPhysicsOperation.PlatformPhysicsOperation(node, move_vector) From db8b0acdded697489eb507b274d7b418b4c83d97 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 3 Jun 2015 19:10:21 +0200 Subject: [PATCH 2/8] Ignore selection when moving objects due to collision Fixes #35 --- cura/PlatformPhysics.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index c52e8a9174..5e4bd5a415 100644 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -11,6 +11,7 @@ from UM.Math.Float import Float from UM.Math.Vector import Vector from UM.Math.AxisAlignedBox import AxisAlignedBox from UM.Application import Application +from UM.Scene.Selection import Selection from . import PlatformPhysicsOperation from . import ConvexHullJob @@ -60,6 +61,8 @@ class PlatformPhysics: job = ConvexHullJob.ConvexHullJob(node) job.start() node._convex_hull_job = job + elif Selection.isSelected(node): + pass else: # Check for collisions between convex hulls for other_node in BreadthFirstIterator(root): From 367b8791aecee16bc1d426b3ead3bee2065eff1e Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 3 Jun 2015 20:29:53 +0200 Subject: [PATCH 3/8] Render the build platform grid as a single sided plane This allows us to look at objects from beneath the object. Also fixes #14 --- cura/BuildVolume.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 85806542f8..97a3888c6e 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -62,7 +62,7 @@ class BuildVolume(SceneNode): self._grid_material.setUniformValue("u_gridColor1", Color(205, 202, 201, 255)) renderer.queueNode(self, material = self._material, mode = Renderer.RenderLines) - renderer.queueNode(self, mesh = self._grid_mesh, material = self._grid_material) + renderer.queueNode(self, mesh = self._grid_mesh, material = self._grid_material, force_single_sided = True) if self._disallowed_area_mesh: renderer.queueNode(self, mesh = self._disallowed_area_mesh, material = self._material) return True @@ -99,10 +99,10 @@ class BuildVolume(SceneNode): mb = MeshBuilder() mb.addQuad( - Vector(minW, minH, maxD), - Vector(maxW, minH, maxD), + Vector(minW, minH, minD), Vector(maxW, minH, minD), - Vector(minW, minH, minD) + Vector(maxW, minH, maxD), + Vector(minW, minH, maxD) ) self._grid_mesh = mb.getData() for n in range(0, 6): From 24a8edd2ae955a968acf40356c5aa772b83b7dbf Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 3 Jun 2015 21:00:58 +0200 Subject: [PATCH 4/8] Make button tooltip text use the dark color from the palette This fixes a regression where tooltip text was white --- resources/themes/cura/styles.qml | 2 +- resources/themes/cura/theme.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 9e9cc11e42..dc2b80d2ad 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -73,7 +73,7 @@ QtObject { anchors.horizontalCenter: parent.horizontalCenter; text: control.text; font: UM.Theme.fonts.button_tooltip; - color: UM.Theme.colors.button_text; + color: UM.Theme.colors.button_tooltip_text; } } } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index f73360d439..a79636aece 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -63,6 +63,7 @@ "button_active_hover": [34, 150, 190, 255], "button_text": [255, 255, 255, 255], "button_disabled": [245, 245, 245, 255], + "button_tooltip_text": [35, 35, 35, 255], "scrollbar_background": [245, 245, 245, 255], "scrollbar_handle": [205, 202, 201, 255], From 005b02ba10538703c6aa3037e17db3beabcd682c Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 3 Jun 2015 21:56:20 +0200 Subject: [PATCH 5/8] Add changes of 15.05.93 release --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 616f906b34..e62253066b 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,12 @@ Changes since 15.05.91 * Fixed: Text fields will trigger a slice on text change, not only after focus change/enter press. * Fixed: Rotate Tool snaps to incorrect value. +* Fixed: Object Collision would only moved objects to the right. +* Fixed: Object Collision would move the selected object when it should not. +* Fixed: Camera panning now works correctly instead of doing nothing. +* Fixed: Camera would flip around center point at maximum rotation. +* Fixed: Build platform grid blocked view from below objects. +* Fixed: Viewport on MacOSX with high-DPI screens was only taking 1/4th of the window Changes since 15.05.90 ---------------------- From e73d48bc675ed068db0cb8f61bf5ce0d12ae2008 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 4 Jun 2015 10:29:45 +0200 Subject: [PATCH 6/8] Render a transparent ghost of the selection when things are selected. Fixes Asana issue about layer view --- plugins/LayerView/LayerView.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 576feb6cb4..96ff102a14 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -5,6 +5,8 @@ from UM.View.View import View from UM.View.Renderer import Renderer from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Resources import Resources +from UM.Scene.Selection import Selection +from UM.Math.Color import Color ## View used to display g-code paths. class LayerView(View): @@ -23,9 +25,15 @@ class LayerView(View): self._material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, "basic.vert"), Resources.getPath(Resources.ShadersLocation, "vertexcolor.frag")) self._material.setUniformValue("u_color", [1.0, 0.0, 0.0, 1.0]) + self._selection_material = renderer.createMaterial(Resources.getPath(Resources.ShadersLocation, "basic.vert"), Resources.getPath(Resources.ShadersLocation, "color.frag")) + self._selection_material.setUniformValue("u_color", Color(35, 35, 35, 128)) + for node in DepthFirstIterator(scene.getRoot()): if not node.render(renderer): if node.getMeshData() and node.isVisible(): + if Selection.isSelected(node): + renderer.queueNode(node, material = self._selection_material, transparent = True) + try: layer_data = node.getMeshData().layerData except AttributeError: @@ -43,9 +51,9 @@ class LayerView(View): if layer >= end_layer: break - renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines, start = start, end = end) + renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines, start = start, end = end, overlay = True) else: - renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines) + renderer.queueNode(node, mesh = layer_data, material = self._material, mode = Renderer.RenderLines, overlay = True) def setLayer(self, value): self._layer_percentage = value From 1f9f253292bd1af8385e937aaff13a2c6d625bfd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 4 Jun 2015 11:12:31 +0200 Subject: [PATCH 7/8] Added exception handling to listen thread join --- plugins/USBPrinting/PrinterConnection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/USBPrinting/PrinterConnection.py b/plugins/USBPrinting/PrinterConnection.py index ad231f5207..19c5b5c07a 100644 --- a/plugins/USBPrinting/PrinterConnection.py +++ b/plugins/USBPrinting/PrinterConnection.py @@ -244,7 +244,10 @@ class PrinterConnection(SignalEmitter): self._connect_thread.join() if self._serial is not None: self.setIsConnected(False) - self._listen_thread.join() + try: + self._listen_thread.join() + except: + pass self._serial.close() self._serial = None From 797f9ec426caf10ebed079e617abd200ad9632e2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 4 Jun 2015 11:23:15 +0200 Subject: [PATCH 8/8] Updated name in menu for firmware update --- plugins/USBPrinting/USBPrinterManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterManager.py b/plugins/USBPrinting/USBPrinterManager.py index ba515594ae..27ff31647b 100644 --- a/plugins/USBPrinting/USBPrinterManager.py +++ b/plugins/USBPrinting/USBPrinterManager.py @@ -40,7 +40,8 @@ class USBPrinterManager(QObject, SignalEmitter, Extension): self._error_message = "" ## Add menu item to top menu of the application. - self.addMenuItem(i18n_catalog.i18n("Update Firmware"), self.updateAllFirmware) + self.setMenuName("Firmware") + self.addMenuItem(i18n_catalog.i18n("Update"), self.updateAllFirmware) pyqtError = pyqtSignal(str, arguments = ["amount"]) processingProgress = pyqtSignal(float, arguments = ["amount"])