Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Prado Gesto <d.pradogesto@ultimaker.com>2018-07-03 14:09:05 +0300
committerDiego Prado Gesto <d.pradogesto@ultimaker.com>2018-07-03 14:09:05 +0300
commitff6bc9de4e686ba5fbdbd853569e13d472bb1186 (patch)
tree2047c5025f6f51d868b052ac3342995fa63c7071 /cura/PickingPass.py
parentae7875a7567bbc7ccdd808e7055e5becb2a0ec2f (diff)
Fix some more code-style
Diffstat (limited to 'cura/PickingPass.py')
-rw-r--r--cura/PickingPass.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cura/PickingPass.py b/cura/PickingPass.py
index bfe465ff39..75ee21ef41 100644
--- a/cura/PickingPass.py
+++ b/cura/PickingPass.py
@@ -69,6 +69,7 @@ class PickingPass(RenderPass):
## Get the world coordinates of a picked point
def getPickedPosition(self, x: int, y: int) -> Vector:
distance = self.getPickedDepth(x, y)
- ray = self._scene.getActiveCamera().getRay(x, y)
-
- return ray.getPointAlongRay(distance)
+ camera = self._scene.getActiveCamera()
+ if camera:
+ return camera.getRay(x, y).getPointAlongRay(distance)
+ return Vector()