mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 19:13:16 +08:00
Ensure that objects outside build volume are not added to thumbnail
CURA-6545
This commit is contained in:
parent
f6627daa49
commit
07ff08f6bb
@ -84,6 +84,7 @@ class PreviewPass(RenderPass):
|
|||||||
|
|
||||||
# Fill up the batch with objects that can be sliced.
|
# Fill up the batch with objects that can be sliced.
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
|
for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
|
||||||
|
if hasattr(node, "_outside_buildarea") and not node._outside_buildarea:
|
||||||
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible():
|
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible():
|
||||||
per_mesh_stack = node.callDecoration("getStack")
|
per_mesh_stack = node.callDecoration("getStack")
|
||||||
if node.callDecoration("isNonThumbnailVisibleMesh"):
|
if node.callDecoration("isNonThumbnailVisibleMesh"):
|
||||||
|
@ -48,12 +48,12 @@ class Snapshot:
|
|||||||
# determine zoom and look at
|
# determine zoom and look at
|
||||||
bbox = None
|
bbox = None
|
||||||
for node in DepthFirstIterator(root):
|
for node in DepthFirstIterator(root):
|
||||||
|
if hasattr(node, "_outside_buildarea") and not node._outside_buildarea:
|
||||||
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonThumbnailVisibleMesh"):
|
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonThumbnailVisibleMesh"):
|
||||||
if bbox is None:
|
if bbox is None:
|
||||||
bbox = node.getBoundingBox()
|
bbox = node.getBoundingBox()
|
||||||
else:
|
else:
|
||||||
bbox = bbox + node.getBoundingBox()
|
bbox = bbox + node.getBoundingBox()
|
||||||
|
|
||||||
# If there is no bounding box, it means that there is no model in the buildplate
|
# If there is no bounding box, it means that there is no model in the buildplate
|
||||||
if bbox is None:
|
if bbox is None:
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user