diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-28 11:47:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-28 11:47:58 +0400 |
commit | ecf2d1ff4e2b6d29caa9bffad7d91aa945709531 (patch) | |
tree | 6e875d85f02721d283ffa26af6e1b7c5a73b4bba /release | |
parent | 20ae95422e9af2c1d3f927d932a20459f2387cac (diff) |
- generate sphinx docs for bpy_extras module
- add in support to doc generator for automatically generating docs for submodules.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy_extras/image_utils.py | 12 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/io_utils.py | 14 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/mesh_utils.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/object_utils.py | 6 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/view3d_utils.py | 12 |
5 files changed, 49 insertions, 3 deletions
diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index 39e49ee1f96..4789fbc606a 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -18,10 +18,20 @@ # <pep8 compliant> +__all__ = ( + "image_load", +) + def image_load(filepath, dirpath, place_holder=False, recursive=False, convert_callback=None): import bpy + import os + try: return bpy.data.images.load(filepath) except RuntimeError: - return bpy.data.images.new("Untitled", 128, 128) + if place_holder: + image = bpy.data.images.new(os.path.basename(filepath), 128, 128) + # allow the path to be resolved later + image.filepath = filepath + return image diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index e51309c5d90..b3bfe3d2737 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -18,6 +18,20 @@ # <pep8 compliant> +__all__ = ( + "ExportHelper", + "ImportHelper", + "axis_conversion", + "load_image", + "create_derived_objects", + "free_derived_objects", + "unpack_list", + "unpack_face_list", + "path_reference", + "path_reference_copy", + "path_reference_mode", +) + import bpy from bpy.props import StringProperty, BoolProperty, EnumProperty diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py index 9ec8ee98e41..1f1c26a5405 100644 --- a/release/scripts/modules/bpy_extras/mesh_utils.py +++ b/release/scripts/modules/bpy_extras/mesh_utils.py @@ -18,6 +18,14 @@ # <pep8 compliant> +__all__ = ( + "mesh_linked_faces", + "edge_face_count_dict", + "edge_face_count", + "edge_loops_from_faces", + "edge_loops_from_edges", + "ngon_tesselate", +) def mesh_linked_faces(mesh): ''' diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py index 1cf7fc2f4d5..606f8b9f89f 100644 --- a/release/scripts/modules/bpy_extras/object_utils.py +++ b/release/scripts/modules/bpy_extras/object_utils.py @@ -18,6 +18,12 @@ # <pep8 compliant> +__all__ = ( + "add_object_align_init", + "object_data_add", +) + + import bpy import mathutils 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: |