diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-26 01:31:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-26 01:31:19 +0400 |
commit | 2cd5436a81da5c15ac70bd2b80c2f062cce5d02e (patch) | |
tree | 2cc12476fb3fa653042eef99fa6b5d4d8cb290ec /release/scripts/modules | |
parent | 4ced91da47ec1e95d71beef07b218fd0290ff68a (diff) | |
parent | 02d72b5c076f4ae1b47da74fe7a60a916edad9f2 (diff) |
svn merge ^/trunk/blender -r42839:42871
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy_extras/keyconfig_utils.py | 1 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 19 |
2 files changed, 10 insertions, 10 deletions
diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index fab6886b314..a9eb86aaf79 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -89,7 +89,6 @@ KM_HIERARCHY = [ ('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu - ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []), ('Text', 'TEXT_EDITOR', 'WINDOW', []), ('Console', 'CONSOLE', 'WINDOW', []), ('Clip', 'CLIP_EDITOR', 'WINDOW', [ diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index 32f7b654690..edc17c36c36 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -42,6 +42,7 @@ def region_2d_to_vector_3d(region, rv3d, coord): """ from mathutils import Vector + viewinv = rv3d.view_matrix.inverted() if rv3d.is_perspective: persinv = rv3d.perspective_matrix.inverted() @@ -50,13 +51,11 @@ def region_2d_to_vector_3d(region, rv3d, coord): -0.5 )) - w = ((out[0] * persinv[0][3]) + - (out[1] * persinv[1][3]) + - (out[2] * persinv[2][3]) + persinv[3][3]) + w = out.dot(persinv[3].xyz) + persinv[3][3] - return ((persinv * out) / w) - rv3d.view_matrix.inverted()[3].xyz + return ((persinv * out) / w) - viewinv.translation else: - return rv3d.view_matrix.inverted()[2].xyz.normalized() + return viewinv.col[2].xyz.normalized() def region_2d_to_location_3d(region, rv3d, coord, depth_location): @@ -81,15 +80,16 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location): from mathutils.geometry import intersect_point_line persmat = rv3d.perspective_matrix.copy() + viewinv = rv3d.view_matrix.inverted() coord_vec = region_2d_to_vector_3d(region, rv3d, coord) depth_location = Vector(depth_location) if rv3d.is_perspective: from mathutils.geometry import intersect_line_plane - origin_start = rv3d.view_matrix.inverted()[3].to_3d() + origin_start = viewinv.translation.copy() origin_end = origin_start + coord_vec - view_vec = rv3d.view_matrix.inverted()[2] + view_vec = viewinv.col[2].copy() return intersect_line_plane(origin_start, origin_end, depth_location, @@ -100,8 +100,9 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location): dy = (2.0 * coord[1] / region.height) - 1.0 persinv = persmat.inverted() viewinv = rv3d.view_matrix.inverted() - origin_start = ((persinv[0].xyz * dx) + - (persinv[1].xyz * dy) + viewinv[3].xyz) + origin_start = ((persinv.col[0].xyz * dx) + + (persinv.col[1].xyz * dy) + + viewinv.translation) origin_end = origin_start + coord_vec return intersect_point_line(depth_location, origin_start, |