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/scripts/modules/bpy_extras/image_utils.py | |
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/scripts/modules/bpy_extras/image_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/image_utils.py | 12 |
1 files changed, 11 insertions, 1 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 |