Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-08-12 10:31:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-12 10:31:39 +0400
commit8fd246cb708569eff223c2da145395cc5ef99402 (patch)
tree47ebf843db608dfcfd14d96fc5dfc82136f17ce9 /release
parentada88c8d8ed051465e8db7ba0b856a6b065cb2d5 (diff)
add bpy.types as a module for convenient imports, eg:
from bpy.types import Menu
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy/__init__.py14
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