diff options
author | Germano <germano.costa@ig.com.br> | 2017-09-19 00:18:18 +0300 |
---|---|---|
committer | Germano <germano.costa@ig.com.br> | 2017-09-19 00:18:18 +0300 |
commit | 756188a4599fc076bc67d1ff05cb9601404cf235 (patch) | |
tree | bfa18931f39b82bc05797555f09375ed3a8e3c87 | |
parent | d73913205c139119b5542d174c412f55d641c100 (diff) |
snap_context module: Fix depth_range in Ortho view
Objects behind the coordinate `(0, 0, 0)` were being ignored with snap in Ortho view
-rw-r--r-- | modules/snap_context/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/snap_context/__init__.py b/modules/snap_context/__init__.py index 834ad802..b0dd0fae 100644 --- a/modules/snap_context/__init__.py +++ b/modules/snap_context/__init__.py @@ -53,8 +53,13 @@ class SnapContext(): self._offset_cur = 1 # Starts with index 1 self.region = region self.rv3d = space.region_3d + + if self.rv3d.is_perspective: + self.depth_range = Vector((space.clip_start, space.clip_end)) + else: + self.depth_range = Vector((-space.clip_end, space.clip_end)) + self.proj_mat = Matrix.Identity(4) - self.depth_range = Vector((space.clip_start, space.clip_end)) self.mval = Vector((0, 0)) self._snap_mode = VERT | EDGE | FACE |