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
|
|
|
|
2009-12-05 22:03:07 +00:00
|
|
|
# <pep8 compliant>
|
|
|
|
|
2011-04-03 23:11:00 +00:00
|
|
|
"""
|
|
|
|
Give access to blender data and utility functions.
|
|
|
|
"""
|
|
|
|
|
2009-11-13 09:28:05 +00:00
|
|
|
# internal blender C module
|
|
|
|
import _bpy
|
2010-01-31 21:52:26 +00:00
|
|
|
from _bpy import types, props, app
|
2009-11-13 09:28:05 +00:00
|
|
|
|
|
|
|
data = _bpy.data
|
|
|
|
context = _bpy.context
|
|
|
|
|
|
|
|
# python modules
|
2010-11-20 02:56:58 +00:00
|
|
|
from . import utils, path
|
|
|
|
from . import ops as _ops_module
|
2009-09-28 04:29:01 +00:00
|
|
|
|
2009-11-22 11:23:19 +00:00
|
|
|
# fake operator module
|
|
|
|
ops = _ops_module.ops_fake_module
|
2009-11-19 16:15:22 +00:00
|
|
|
|
2010-01-20 19:26:23 +00:00
|
|
|
import sys as _sys
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-05 20:45:51 +00:00
|
|
|
|
2009-11-22 11:23:19 +00:00
|
|
|
def _main():
|
|
|
|
|
2010-12-11 11:52:28 +00:00
|
|
|
# Possibly temp. addons path
|
|
|
|
from os.path import join, dirname, normpath
|
|
|
|
_sys.path.append(normpath(join(dirname(__file__), "..", "..", "addons", "modules")))
|
2010-03-21 14:56:26 +00:00
|
|
|
|
2009-12-05 20:45:51 +00:00
|
|
|
# if "-d" in sys.argv: # Enable this to measure startup speed
|
|
|
|
if 0:
|
2009-11-22 11:23:19 +00:00
|
|
|
import cProfile
|
2010-01-28 11:48:06 +00:00
|
|
|
cProfile.run('import bpy; bpy.utils.load_scripts()', 'blender.prof')
|
2009-11-22 11:23:19 +00:00
|
|
|
|
|
|
|
import pstats
|
|
|
|
p = pstats.Stats('blender.prof')
|
|
|
|
p.sort_stats('cumulative').print_stats(100)
|
|
|
|
|
|
|
|
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
|
|
|
|
2009-11-22 11:23:19 +00:00
|
|
|
_main()
|