diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-22 05:01:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-22 05:11:45 +0400 |
commit | 61baf6e8135d11bc53cbfa45c75f910a99e57971 (patch) | |
tree | 26cd515da4240d2fb3344fcacb5717f4af2fd0cf /release/scripts/modules | |
parent | 217095f622282d5ec9ded524ddd7f24c68ed11f5 (diff) |
Fix T41902: Flipped persp/ortho region_2d_to_vector_3d
- Ortho result from view3d_utils.region_2d_to_vector_3d was flipped.
- Persp result wasn't normalized.
- operator_modal_view3d_raycast.py failed for ortho views.
Thanks to Philipp Oeser for the initial fix.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index ad555a417d7..b25024fca9b 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -54,9 +54,13 @@ def region_2d_to_vector_3d(region, rv3d, coord): w = out.dot(persinv[3].xyz) + persinv[3][3] - return ((persinv * out) / w) - viewinv.translation + view_vector = ((persinv * out) / w) - viewinv.translation else: - return viewinv.col[2].xyz.normalized() + view_vector = -viewinv.col[2].xyz + + view_vector.normalize() + + return view_vector def region_2d_to_origin_3d(region, rv3d, coord): |