mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 00:45:13 +08:00
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:
parent
7d98167383
commit
ab32d64c01
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user