From 0f807cd03e377118e671c4e8e5ab57f7c11f5fbb Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Tue, 24 Oct 2017 17:38:06 +0200 Subject: [PATCH 1/5] Wfter changing the view the old view is removed from rendering CURA-4062 --- plugins/LayerView/LayerView.py | 1 + plugins/XRayView/XRayView.py | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index d23dd90915..7543907780 100755 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -335,6 +335,7 @@ class LayerView(View): if self._global_container_stack: self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged) + self.getRenderer().removeRenderPass(self._layer_pass) self._composite_pass.setLayerBindings(self._old_layer_bindings) self._composite_pass.setCompositeShader(self._old_composite_shader) diff --git a/plugins/XRayView/XRayView.py b/plugins/XRayView/XRayView.py index ed8d14b8b4..e7715209d0 100644 --- a/plugins/XRayView/XRayView.py +++ b/plugins/XRayView/XRayView.py @@ -74,5 +74,6 @@ class XRayView(View): self._composite_pass.setCompositeShader(self._xray_composite_shader) if event.type == Event.ViewDeactivateEvent: + self.getRenderer().removeRenderPass(self._xray_pass) self._composite_pass.setLayerBindings(self._old_layer_bindings) self._composite_pass.setCompositeShader(self._old_composite_shader) From d2873dc65a7e553555e44b5faf6c781d6a04eaaa Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Wed, 25 Oct 2017 11:06:12 +0200 Subject: [PATCH 2/5] The view class were not added after to the rendering list after changing them CURA-4062 --- plugins/LayerView/LayerView.py | 5 +++-- plugins/XRayView/XRayView.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 7543907780..a7dbb88209 100755 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -112,7 +112,7 @@ class LayerView(View): self._layer_pass = LayerPass.LayerPass(1, 1) self._compatibility_mode = OpenGLContext.isLegacyOpenGL() or bool(Preferences.getInstance().getValue("view/force_layer_view_compatibility_mode")) self._layer_pass.setLayerView(self) - self.getRenderer().addRenderPass(self._layer_pass) + #self.getRenderer().addRenderPass(self._layer_pass) return self._layer_pass def getCurrentLayer(self): @@ -310,7 +310,8 @@ class LayerView(View): if event.type == Event.ViewActivateEvent: # Make sure the LayerPass is created - self.getLayerPass() + layer_pass = self.getLayerPass() + self.getRenderer().addRenderPass(layer_pass) Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged) self._onGlobalStackChanged() diff --git a/plugins/XRayView/XRayView.py b/plugins/XRayView/XRayView.py index e7715209d0..2983772647 100644 --- a/plugins/XRayView/XRayView.py +++ b/plugins/XRayView/XRayView.py @@ -56,6 +56,8 @@ class XRayView(View): # Currently the RenderPass constructor requires a size > 0 # This should be fixed in RenderPass's constructor. self._xray_pass = XRayPass.XRayPass(1, 1) + + if self._xray_pass: self.getRenderer().addRenderPass(self._xray_pass) if not self._xray_composite_shader: From 938ae5af1deaffe53ef3244f6ff0f59e06442f12 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Thu, 26 Oct 2017 14:36:23 +0200 Subject: [PATCH 3/5] Added function to catch prepare and monitor button click CURA-4062 --- resources/qml/Topbar.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 5dacfc72ea..c69c786d5a 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -30,9 +30,11 @@ Rectangle Component.onCompleted: { startMonitoringPrint.connect(function () { base.monitoringPrint = true + UM.Controller.disableModelRendering() }) stopMonitoringPrint.connect(function () { base.monitoringPrint = false + UM.Controller.enableModelRendering() }) } From ee228155af1677f3f375fb0b28b53ecef744d4d2 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 27 Oct 2017 09:24:31 +0200 Subject: [PATCH 4/5] Remove unnecessary properties which after update triggered view rendering CURA-4062 --- resources/qml/Cura.qml | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index cb0211f29f..934fc58017 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -344,9 +344,6 @@ UM.MainWindow { id: toolbar; - property int mouseX: base.mouseX - property int mouseY: base.mouseY - anchors { top: openFileButton.bottom; topMargin: UM.Theme.getSize("window_margin").height; From c85e10f4c5b124767002fafd8666c3236437960f Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 1 Nov 2017 13:31:17 +0100 Subject: [PATCH 5/5] CURA-4062 Minor changes --- plugins/LayerView/LayerView.py | 1 - plugins/XRayView/XRayView.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index a7dbb88209..04be97b747 100755 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -112,7 +112,6 @@ class LayerView(View): self._layer_pass = LayerPass.LayerPass(1, 1) self._compatibility_mode = OpenGLContext.isLegacyOpenGL() or bool(Preferences.getInstance().getValue("view/force_layer_view_compatibility_mode")) self._layer_pass.setLayerView(self) - #self.getRenderer().addRenderPass(self._layer_pass) return self._layer_pass def getCurrentLayer(self): diff --git a/plugins/XRayView/XRayView.py b/plugins/XRayView/XRayView.py index 2983772647..35509a9715 100644 --- a/plugins/XRayView/XRayView.py +++ b/plugins/XRayView/XRayView.py @@ -57,8 +57,7 @@ class XRayView(View): # This should be fixed in RenderPass's constructor. self._xray_pass = XRayPass.XRayPass(1, 1) - if self._xray_pass: - self.getRenderer().addRenderPass(self._xray_pass) + self.getRenderer().addRenderPass(self._xray_pass) if not self._xray_composite_shader: self._xray_composite_shader = OpenGL.getInstance().createShaderProgram(os.path.join(PluginRegistry.getInstance().getPluginPath("XRayView"), "xray_composite.shader"))