2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-07 22:07:46 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-07 22:07:46 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2011-07-31 03:15:37 +00:00
|
|
|
# <pep8-80 compliant>
|
2009-12-05 22:03:07 +00:00
|
|
|
|
2011-04-03 23:11:00 +00:00
|
|
|
"""
|
|
|
|
Give access to blender data and utility functions.
|
|
|
|
"""
|
|
|
|
|
2011-06-29 10:47:43 +00:00
|
|
|
__all__ = (
|
|
|
|
"app",
|
|
|
|
"context",
|
|
|
|
"data",
|
|
|
|
"ops",
|
|
|
|
"path",
|
|
|
|
"props",
|
|
|
|
"types",
|
|
|
|
"utils",
|
2011-07-31 03:15:37 +00:00
|
|
|
)
|
2011-06-29 10:47:43 +00:00
|
|
|
|
2009-11-13 09:28:05 +00:00
|
|
|
|
2011-06-29 10:47:43 +00:00
|
|
|
# internal blender C module
|
|
|
|
from _bpy import types, props, app, data, context
|
2009-11-13 09:28:05 +00:00
|
|
|
|
|
|
|
# python modules
|
2011-06-29 10:47:43 +00:00
|
|
|
from . import utils, path, ops
|
2009-09-28 04:29:01 +00:00
|
|
|
|
2009-11-22 11:23:19 +00:00
|
|
|
# fake operator module
|
2011-06-29 10:47:43 +00:00
|
|
|
ops = ops.ops_fake_module
|
2009-12-05 20:45:51 +00:00
|
|
|
|
2011-07-29 01:24:03 +00:00
|
|
|
|
2011-08-12 06:31:39 +00:00
|
|
|
def main():
|
|
|
|
import sys
|
2009-11-22 11:23:19 +00:00
|
|
|
|
2010-12-11 11:52:28 +00:00
|
|
|
# Possibly temp. addons path
|
|
|
|
from os.path import join, dirname, normpath
|
2011-08-12 06:31:39 +00:00
|
|
|
sys.path.append(normpath(join(dirname(__file__),
|
2012-03-28 23:53:27 +00:00
|
|
|
"..", "..", "addons", "modules")))
|
|
|
|
sys.path.append(join(utils.user_resource('SCRIPTS'),
|
|
|
|
"addons", "modules"))
|
2010-03-21 14:56:26 +00:00
|
|
|
|
2011-08-12 06:31:39 +00:00
|
|
|
# fake module to allow:
|
|
|
|
# from bpy.types import Panel
|
2011-11-03 09:13:47 +00:00
|
|
|
sys.modules["bpy.app"] = app
|
|
|
|
sys.modules["bpy.app.handlers"] = app.handlers
|
2013-02-10 09:56:05 +00:00
|
|
|
sys.modules["bpy.app.translations"] = app.translations
|
2011-08-12 06:31:39 +00:00
|
|
|
sys.modules["bpy.types"] = types
|
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
#~ if "-d" in sys.argv: # Enable this to measure start up speed
|
2009-12-05 20:45:51 +00:00
|
|
|
if 0:
|
2009-11-22 11:23:19 +00:00
|
|
|
import cProfile
|
2012-06-19 22:17:19 +00:00
|
|
|
cProfile.run("import bpy; bpy.utils.load_scripts()", "blender.prof")
|
2009-11-22 11:23:19 +00:00
|
|
|
|
|
|
|
import pstats
|
2012-06-19 22:17:19 +00:00
|
|
|
p = pstats.Stats("blender.prof")
|
|
|
|
p.sort_stats("cumulative").print_stats(100)
|
2009-11-22 11:23:19 +00:00
|
|
|
|
|
|
|
else:
|
2010-01-28 11:48:06 +00:00
|
|
|
utils.load_scripts()
|
2009-11-22 11:23:19 +00:00
|
|
|
|
2009-12-28 10:00:04 +00:00
|
|
|
|
2011-08-12 06:31:39 +00:00
|
|
|
main()
|
2011-06-29 10:47:43 +00:00
|
|
|
|
2011-08-12 06:31:39 +00:00
|
|
|
del main
|