add bpy.types as a module for convenient imports, eg:

from bpy.types import Menu
This commit is contained in:
Campbell Barton 2011-08-12 06:31:39 +00:00
parent ada88c8d8e
commit 8fd246cb70

@ -44,14 +44,18 @@ from . import utils, path, ops
ops = ops.ops_fake_module ops = ops.ops_fake_module
def _main(): def main():
import sys as _sys import sys
# Possibly temp. addons path # Possibly temp. addons path
from os.path import join, dirname, normpath from os.path import join, dirname, normpath
_sys.path.append(normpath(join(dirname(__file__), sys.path.append(normpath(join(dirname(__file__),
"..", "..", "addons", "modules"))) "..", "..", "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 "-d" in sys.argv: # Enable this to measure startup speed
if 0: if 0:
import cProfile import cProfile
@ -65,6 +69,6 @@ def _main():
utils.load_scripts() utils.load_scripts()
_main() main()
del _main del main