mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 02:36:02 +08:00
Prevend unneeded tickles of the backend for setting override decorators
This commit is contained in:
parent
1755ed64ea
commit
abb13e8992
@ -114,12 +114,19 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
||||
def _onSettingChanged(self, instance, property_name): # Reminder: 'property' is a built-in function
|
||||
if property_name == "value":
|
||||
# Trigger slice/need slicing if the value has changed.
|
||||
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()
|
||||
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
|
||||
self._node.setCalculateBoundingBox(not self._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()
|
||||
|
||||
## Makes sure that the stack upon which the container stack is placed is
|
||||
# kept up to date.
|
||||
|
Loading…
x
Reference in New Issue
Block a user