Account for the fact that global_stack may be empty

You should not have any models in your scene then though. But oh well. It also fixes the typing.

Contributes to issue CURA-7118.
This commit is contained in:
Ghostkeeper 2020-09-02 03:21:11 +02:00
parent 323be4deff
commit 59bf1c10af
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -381,7 +381,8 @@ class ConvexHullDecorator(SceneNodeDecorator):
:return: New Polygon instance that is offset with everything that :return: New Polygon instance that is offset with everything that
influences the collision area. influences the collision area.
""" """
if not self._global_stack: # Should never happen.
return convex_hull
scale_factor = self._global_stack.getProperty("material_shrinkage_percentage", "value") / 100.0 scale_factor = self._global_stack.getProperty("material_shrinkage_percentage", "value") / 100.0
result = convex_hull result = convex_hull
if scale_factor != 1.0: if scale_factor != 1.0: