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.
This commit is contained in:
Ghostkeeper 2018-01-22 17:21:03 +01:00
parent 1c605a5108
commit 5c8d46b5c2
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -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. # Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import QTimer from PyQt5.QtCore import QTimer
@ -57,7 +57,7 @@ class PlatformPhysics:
nodes = list(BreadthFirstIterator(root)) nodes = list(BreadthFirstIterator(root))
# Only check nodes inside build area. # 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) random.shuffle(nodes)
for node in nodes: for node in nodes: