mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 13:17:51 -06:00
Fix reslice when deleting nodes, fix moving groups. CURA-3412
This commit is contained in:
parent
807542cc1f
commit
0eec48b9e3
1 changed files with 20 additions and 7 deletions
|
@ -105,6 +105,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
|
|
||||||
self._backend_log_max_lines = 20000 # Maximum number of lines to buffer
|
self._backend_log_max_lines = 20000 # Maximum number of lines to buffer
|
||||||
self._error_message = None # Pop-up message that shows errors.
|
self._error_message = None # Pop-up message that shows errors.
|
||||||
|
self._last_num_objects = 0 # Count number of objects to see if there is something changed
|
||||||
|
|
||||||
self.backendQuit.connect(self._onBackendQuit)
|
self.backendQuit.connect(self._onBackendQuit)
|
||||||
self.backendConnected.connect(self._onBackendConnected)
|
self.backendConnected.connect(self._onBackendConnected)
|
||||||
|
@ -346,16 +347,28 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
if type(source) is not SceneNode:
|
if type(source) is not SceneNode:
|
||||||
return
|
return
|
||||||
|
|
||||||
if source is self._scene.getRoot():
|
root_scene_nodes_changed = False
|
||||||
return
|
if source == self._scene.getRoot():
|
||||||
|
num_objects = 0
|
||||||
|
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||||
|
# For now this seems to be a reliable method to check for nodes that impact slicing
|
||||||
|
# From: SliceInfo, _onWriteStarted
|
||||||
|
if type(node) is not SceneNode or not node.getMeshData():
|
||||||
|
continue
|
||||||
|
num_objects += 1
|
||||||
|
if num_objects != self._last_num_objects:
|
||||||
|
self._last_num_objects = num_objects
|
||||||
|
root_scene_nodes_changed = True
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
self.determineAutoSlicing()
|
self.determineAutoSlicing()
|
||||||
|
|
||||||
if source.getMeshData() is None:
|
if not source.callDecoration("isGroup") and not root_scene_nodes_changed:
|
||||||
return
|
if source.getMeshData() is None:
|
||||||
|
return
|
||||||
if source.getMeshData().getVertices() is None:
|
if source.getMeshData().getVertices() is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.needsSlicing()
|
self.needsSlicing()
|
||||||
self.stopSlicing()
|
self.stopSlicing()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue