diff options
Diffstat (limited to 'release/scripts/modules/bpy_extras/view3d_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index ef2e20c4908..45f537ebd2f 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -18,6 +18,12 @@ # <pep8 compliant> +__all__ = ( + "region_2d_to_vector_3d", + "region_2d_to_location_3d", + "location_3d_to_region_2d", + "location_3d_to_region_2d", +) def region_2d_to_vector_3d(region, rv3d, coord): """ @@ -28,7 +34,7 @@ def region_2d_to_vector_3d(region, rv3d, coord): :type region: :class:`Region` :arg rv3d: 3D region data, typically bpy.context.space_data.region_3d. :type rv3d: :class:`RegionView3D` - :arg coord: 2d coordinates relative to the region; + :arg coord: 2d coordinates relative to the region: (event.mouse_region_x, event.mouse_region_y) for example. :type coord: 2d vector :return: normalized 3d vector. @@ -44,7 +50,9 @@ 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[0] * persinv[0][3]) + \ + (out[1] * persinv[1][3]) + \ + (out[2] * persinv[2][3]) + persinv[3][3] return ((out * persinv) / w) - rv3d.view_matrix.inverted()[3].xyz else: |