Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2020-02-28 18:31:28 +0300
committerJaime van Kessel <nallath@gmail.com>2020-02-28 18:31:28 +0300
commit27c6cb4c1ebfec4f561b8f95926872e361dd2941 (patch)
tree4ef98e607a0593d69abb48c5a11e4328ba0dc79a /cura/Scene
parentf4d1d5d93637dfea43d59cb5588b351b1681e244 (diff)
Prevent max recursion for convex hull calculation
fixes CURA-3W
Diffstat (limited to 'cura/Scene')
-rw-r--r--cura/Scene/ConvexHullDecorator.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py
index 2a160f6069..b5f5fb4540 100644
--- a/cura/Scene/ConvexHullDecorator.py
+++ b/cura/Scene/ConvexHullDecorator.py
@@ -36,8 +36,10 @@ class ConvexHullDecorator(SceneNodeDecorator):
# Make sure the timer is created on the main thread
self._recompute_convex_hull_timer = None # type: Optional[QTimer]
+ self._timer_scheduled_to_be_created = False
from cura.CuraApplication import CuraApplication
if CuraApplication.getInstance() is not None:
+ self._timer_scheduled_to_be_created = True
CuraApplication.getInstance().callLater(self.createRecomputeConvexHullTimer)
self._raft_thickness = 0.0
@@ -171,7 +173,12 @@ class ConvexHullDecorator(SceneNodeDecorator):
if self._recompute_convex_hull_timer is not None:
self._recompute_convex_hull_timer.start()
else:
- self.recomputeConvexHull()
+ from cura.CuraApplication import CuraApplication
+ if not self._timer_scheduled_to_be_created:
+ # The timer is not created and we never scheduled it. Time to create it now!
+ CuraApplication.getInstance().callLater(self.createRecomputeConvexHullTimer)
+ # Now we know for sure that the timer has been scheduled for creation, so we can try this again.
+ CuraApplication.getInstance().callLater(self.recomputeConvexHullDelayed)
def recomputeConvexHull(self) -> None:
controller = Application.getInstance().getController()