- generate sphinx docs for bpy_extras module

- add in support to doc generator for automatically generating docs for submodules.
This commit is contained in:
2011-05-28 07:47:58 +00:00
parent 20ae95422e
commit ecf2d1ff4e
6 changed files with 128 additions and 22 deletions

View File

@@ -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: