mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Trust the stack values more than the decorator
CURA-4705 A SceneNode and its decorators can be deepcopied. However, the data in some decorators will only be updated when a per-object settings stack triggers a property changed event. That event cannot copied. So, it can happen that a deepcopied SceneNode has inconsistent data in some of its decorators than what's in the per-object settings stack.
This commit is contained in:
parent
1a6a6f74d5
commit
b2ac2e0fc7
1 changed files with 10 additions and 4 deletions
|
@ -19,6 +19,10 @@ from UM.Settings.SettingRelation import RelationType
|
||||||
from cura.OneAtATimeIterator import OneAtATimeIterator
|
from cura.OneAtATimeIterator import OneAtATimeIterator
|
||||||
from cura.Settings.ExtruderManager import ExtruderManager
|
from cura.Settings.ExtruderManager import ExtruderManager
|
||||||
|
|
||||||
|
|
||||||
|
NON_PRINTING_MESH_SETTINGS = ["anti_overhang_mesh", "infill_mesh", "cutting_mesh"]
|
||||||
|
|
||||||
|
|
||||||
class StartJobResult(IntEnum):
|
class StartJobResult(IntEnum):
|
||||||
Finished = 1
|
Finished = 1
|
||||||
Error = 2
|
Error = 2
|
||||||
|
@ -133,11 +137,13 @@ class StartSliceJob(Job):
|
||||||
temp_list = []
|
temp_list = []
|
||||||
has_printing_mesh = False
|
has_printing_mesh = False
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||||
if type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None:
|
if node.callDecoration("isSliceable") and type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None:
|
||||||
_non_printing_mesh = getattr(node, "_non_printing_mesh", False)
|
per_object_stack = node.callDecoration("getStack")
|
||||||
if not getattr(node, "_outside_buildarea", False) or _non_printing_mesh:
|
is_non_printing_mesh = any(per_object_stack.getProperty(key, "value") for key in NON_PRINTING_MESH_SETTINGS)
|
||||||
|
|
||||||
|
if not getattr(node, "_outside_buildarea", False) or not is_non_printing_mesh:
|
||||||
temp_list.append(node)
|
temp_list.append(node)
|
||||||
if not _non_printing_mesh:
|
if not is_non_printing_mesh:
|
||||||
has_printing_mesh = True
|
has_printing_mesh = True
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue