forked from bartvdbraak/blender
add bpy.types as a module for convenient imports, eg:
from bpy.types import Menu
This commit is contained in:
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
|
||||||
|
Loading…
Reference in New Issue
Block a user