From 5c8d46b5c2ff27ff32bfc8e27451d3f8764accf8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 22 Jan 2018 17:21:03 +0100 Subject: [PATCH] Simplify check for _outside_buildarea There is a getter function that has a default if the attribute doesn't exist. Contributes to issue CURA-4797. --- cura/PlatformPhysics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 69890178e4..cf4dd83fef 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import QTimer @@ -57,7 +57,7 @@ class PlatformPhysics: nodes = list(BreadthFirstIterator(root)) # Only check nodes inside build area. - nodes = [node for node in nodes if (hasattr(node, "_outside_buildarea") and not node._outside_buildarea)] + nodes = [node for node in nodes if getattr(node, "_outside_buildarea", False)] random.shuffle(nodes) for node in nodes: