diff options
Diffstat (limited to 'release/scripts/modules/bpy/__init__.py')
-rw-r--r-- | release/scripts/modules/bpy/__init__.py | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 1df8e9e5588..5c371fd750a 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -16,34 +16,45 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8 compliant> +# <pep8-80 compliant> """ Give access to blender data and utility functions. """ -# internal blender C module -import _bpy -from _bpy import types, props, app +__all__ = ( + "app", + "context", + "data", + "ops", + "path", + "props", + "types", + "utils", + ) + -data = _bpy.data -context = _bpy.context +# internal blender C module +from _bpy import types, props, app, data, context # python modules -from . import utils, path -from . import ops as _ops_module +from . import utils, path, ops # fake operator module -ops = _ops_module.ops_fake_module +ops = ops.ops_fake_module -import sys as _sys - -def _main(): +def main(): + import sys # Possibly temp. addons path from os.path import join, dirname, normpath - _sys.path.append(normpath(join(dirname(__file__), "..", "..", "addons", "modules"))) + sys.path.append(normpath(join(dirname(__file__), + "..", "..", "addons", "modules"))) + + # fake module to allow: + # from bpy.types import Panel + sys.modules["bpy.types"] = types # if "-d" in sys.argv: # Enable this to measure startup speed if 0: @@ -58,4 +69,6 @@ def _main(): utils.load_scripts() -_main() +main() + +del main |