From fb33497ff1b7346b727db38196fbddea30d8ff05 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 23 May 2019 11:36:54 +0200 Subject: [PATCH] Fix auto-slice for per-object settings CURA-6539 --- cura/Settings/SettingOverrideDecorator.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py index d1f85d0b30..bfb28cd1f1 100644 --- a/cura/Settings/SettingOverrideDecorator.py +++ b/cura/Settings/SettingOverrideDecorator.py @@ -113,20 +113,14 @@ class SettingOverrideDecorator(SceneNodeDecorator): def _onSettingChanged(self, setting_key, property_name): # Reminder: 'property' is a built-in function # We're only interested in a few settings and only if it's value changed. - if property_name == "value" and (setting_key in self._non_printing_mesh_settings or setting_key in self._non_thumbnail_visible_settings): + if property_name == "value": # Trigger slice/need slicing if the value has changed. - new_is_non_printing_mesh = self._evaluateIsNonPrintingMesh() - new_is_non_thumbnail_visible_mesh = self._evaluateIsNonThumbnailVisibleMesh() - changed = False - if self._is_non_printing_mesh != new_is_non_printing_mesh: - self._is_non_printing_mesh = new_is_non_printing_mesh - changed = True - if self._is_non_thumbnail_visible_mesh != new_is_non_thumbnail_visible_mesh: - changed = True - - if changed: - Application.getInstance().getBackend().needsSlicing() - Application.getInstance().getBackend().tickle() + self._is_non_printing_mesh = self._evaluateIsNonPrintingMesh() + self._is_non_thumbnail_visible_mesh = self._evaluateIsNonThumbnailVisibleMesh() + # Only calculate the bounding box of the mesh if it's an actual mesh (and not a helper) + self._node.setCalculateBoundingBox(not self._is_non_printing_mesh) + Application.getInstance().getBackend().needsSlicing() + Application.getInstance().getBackend().tickle() ## Makes sure that the stack upon which the container stack is placed is # kept up to date.