Reuse node_bounds utility function

This commit is contained in:
c.lamboo 2023-10-23 11:19:28 +02:00
parent 5134540751
commit 6c2a468c18

View File

@ -140,14 +140,7 @@ class Snapshot:
camera = Camera("snapshot", root) camera = Camera("snapshot", root)
# determine zoom and look at # determine zoom and look at
bbox = None bbox = Snapshot.node_bounds(root)
for node in DepthFirstIterator(root):
if not getattr(node, "_outside_buildarea", False):
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonThumbnailVisibleMesh"):
if bbox is None:
bbox = node.getBoundingBox()
else:
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:
Logger.log("w", "Unable to create snapshot as we seem to have an empty buildplate") Logger.log("w", "Unable to create snapshot as we seem to have an empty buildplate")