mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Don't pass support_angle to shader unless it is valid
CURA-2058
This commit is contained in:
parent
2edda68021
commit
ea3e2225ed
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ from UM.Resources import Resources
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
from UM.View.Renderer import Renderer
|
from UM.View.Renderer import Renderer
|
||||||
|
from UM.Settings.Validator import ValidatorState
|
||||||
|
|
||||||
from UM.View.GL.OpenGL import OpenGL
|
from UM.View.GL.OpenGL import OpenGL
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ class SolidView(View):
|
||||||
if Application.getInstance().getGlobalContainerStack():
|
if Application.getInstance().getGlobalContainerStack():
|
||||||
if Preferences.getInstance().getValue("view/show_overhang"):
|
if Preferences.getInstance().getValue("view/show_overhang"):
|
||||||
angle = Application.getInstance().getGlobalContainerStack().getProperty("support_angle", "value")
|
angle = Application.getInstance().getGlobalContainerStack().getProperty("support_angle", "value")
|
||||||
if angle is not None:
|
if angle is not None and Application.getInstance().getGlobalContainerStack().getProperty("support_angle", "validationState") == ValidatorState.Valid:
|
||||||
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - angle)))
|
self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(90 - 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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue