Add types for ShaderPrograms

Otherwise it'll think that this variable can only have None in it.

Contributes to issue CURA-5330.
This commit is contained in:
Ghostkeeper 2018-06-15 11:34:35 +02:00
parent 7d98167383
commit ab32d64c01
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -1,6 +1,8 @@
# Copyright (c) 2018 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 typing import Optional, TYPE_CHECKING
from UM.Application import Application from UM.Application import Application
from UM.Resources import Resources from UM.Resources import Resources
@ -11,7 +13,8 @@ from UM.View.RenderBatch import RenderBatch
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from typing import Optional if TYPE_CHECKING:
from UM.View.GL.ShaderProgram import ShaderProgram
MYPY = False MYPY = False
if MYPY: if MYPY:
@ -41,9 +44,9 @@ class PreviewPass(RenderPass):
self._renderer = Application.getInstance().getRenderer() self._renderer = Application.getInstance().getRenderer()
self._shader = None self._shader = None #type: Optional[ShaderProgram]
self._non_printing_shader = None self._non_printing_shader = None #type: Optional[ShaderProgram]
self._support_mesh_shader = None self._support_mesh_shader = None #type: Optional[ShaderProgram]
self._scene = Application.getInstance().getController().getScene() self._scene = Application.getInstance().getController().getScene()
# Set the camera to be used by this render pass # Set the camera to be used by this render pass