From 782c4508c64ea20393bd66b044164ae1c194afa7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 1 Feb 2016 16:03:31 +0100 Subject: [PATCH] Convex hull is also redrawn when machineInstance is changed CURA-742 --- cura/ConvexHullDecorator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index f16c2a295e..23e4a4fe95 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -17,6 +17,7 @@ class ConvexHullDecorator(SceneNodeDecorator): self._profile = None Application.getInstance().getMachineManager().activeProfileChanged.connect(self._onActiveProfileChanged) + Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineInstanceChanged) self._onActiveProfileChanged() ## Force that a new (empty) object is created upon copy. @@ -67,6 +68,14 @@ class ConvexHullDecorator(SceneNodeDecorator): if self._profile: self._profile.settingValueChanged.connect(self._onSettingValueChanged) + def _onActiveMachineInstanceChanged(self): + if self._convex_hull_job: + self._convex_hull_job.cancel() + self.setConvexHull(None) + if self._convex_hull_node: + self._convex_hull_node.setParent(None) + self._convex_hull_node = None + def _onSettingValueChanged(self, setting): if setting == "print_sequence": if self._convex_hull_job: