Remove another check from rendering code

CURA-7106
This commit is contained in:
Jaime van Kessel 2020-06-22 17:22:47 +02:00
parent 570efc8310
commit f4cc8b4870
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -103,7 +103,9 @@ class SolidView(View):
except IndexError: except IndexError:
pass pass
else: else:
self._support_angle = support_angle_stack.getProperty("support_angle", "value") angle = support_angle_stack.getProperty("support_angle", "value")
if angle is not None:
self._support_angle = angle
def _checkSetup(self): def _checkSetup(self):
if not self._extruders_model: if not self._extruders_model:
@ -178,7 +180,7 @@ class SolidView(View):
if global_container_stack: if global_container_stack:
if Application.getInstance().getPreferences().getValue("view/show_overhang"): if Application.getInstance().getPreferences().getValue("view/show_overhang"):
# Make sure the overhang angle is valid before passing it to the shader # Make sure the overhang angle is valid before passing it to the shader
if self._support_angle is not None and self._support_angle >= 0 and self._support_angle <= 90: if self._support_angle >= 0 and self._support_angle <= 90:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - self._support_angle))) self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - self._support_angle)))
else: else:
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) #Overhang angle of 0 causes no area at all to be marked as overhang. self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) #Overhang angle of 0 causes no area at all to be marked as overhang.