diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-12 10:31:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-12 10:31:39 +0400 |
commit | 8fd246cb708569eff223c2da145395cc5ef99402 (patch) | |
tree | 47ebf843db608dfcfd14d96fc5dfc82136f17ce9 /release/scripts | |
parent | ada88c8d8ed051465e8db7ba0b856a6b065cb2d5 (diff) |
add bpy.types as a module for convenient imports, eg:
from bpy.types import Menu
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/bpy/__init__.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index a43b42e49a1..5c371fd750a 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -44,14 +44,18 @@ from . import utils, path, ops ops = ops.ops_fake_module -def _main(): - import sys as _sys +def main(): + import sys # Possibly temp. addons path from os.path import join, dirname, normpath - _sys.path.append(normpath(join(dirname(__file__), + 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: import cProfile @@ -65,6 +69,6 @@ def _main(): utils.load_scripts() -_main() +main() -del _main +del main |