mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 21:09:01 +08:00
Fix type of self._shader
MyPy was thinking that this variable has type None, which is nonsense because no variable should always have type None. Contributes to issue CURA-5330.
This commit is contained in:
parent
eda0d34fd9
commit
105f6d4271
@ -1,5 +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.Math.Vector import Vector
|
from UM.Math.Vector import Vector
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
@ -10,6 +13,8 @@ from UM.View.RenderBatch import RenderBatch
|
|||||||
|
|
||||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from UM.View.GL.ShaderProgram import ShaderProgram
|
||||||
|
|
||||||
## A RenderPass subclass that renders a the distance of selectable objects from the active camera to a texture.
|
## A RenderPass subclass that renders a the distance of selectable objects from the active camera to a texture.
|
||||||
# The texture is used to map a 2d location (eg the mouse location) to a world space position
|
# The texture is used to map a 2d location (eg the mouse location) to a world space position
|
||||||
@ -21,7 +26,7 @@ class PickingPass(RenderPass):
|
|||||||
|
|
||||||
self._renderer = Application.getInstance().getRenderer()
|
self._renderer = Application.getInstance().getRenderer()
|
||||||
|
|
||||||
self._shader = None
|
self._shader = None #type: Optional[ShaderProgram]
|
||||||
self._scene = Application.getInstance().getController().getScene()
|
self._scene = Application.getInstance().getController().getScene()
|
||||||
|
|
||||||
def render(self) -> None:
|
def render(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user