2023-08-15 14:20:26 +00:00
|
|
|
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
|
2023-06-15 03:09:04 +00:00
|
|
|
#
|
2022-02-10 22:07:11 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2009-10-31 20:16:59 +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",
|
2024-03-17 06:23:16 +00:00
|
|
|
"msgbus",
|
2011-06-29 10:47:43 +00:00
|
|
|
"ops",
|
|
|
|
"path",
|
|
|
|
"props",
|
|
|
|
"types",
|
|
|
|
"utils",
|
2016-07-29 11:22:27 +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
|
2017-11-29 07:00:41 +00:00
|
|
|
from _bpy import (
|
|
|
|
app,
|
|
|
|
context,
|
|
|
|
data,
|
2017-11-13 08:43:34 +00:00
|
|
|
msgbus,
|
2017-11-29 07:00:41 +00:00
|
|
|
props,
|
|
|
|
types,
|
|
|
|
)
|
2009-11-13 09:28:05 +00:00
|
|
|
|
|
|
|
# python modules
|
2017-11-29 07:00:41 +00:00
|
|
|
from . import (
|
2020-10-08 06:43:08 +00:00
|
|
|
ops,
|
2017-11-29 07:00:41 +00:00
|
|
|
path,
|
|
|
|
utils,
|
|
|
|
)
|
2009-09-28 04:29:01 +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
|
2017-03-29 04:07:41 +00:00
|
|
|
from os.path import join, dirname
|
|
|
|
sys.path.extend([
|
|
|
|
join(dirname(dirname(dirname(__file__))), "addons", "modules"),
|
|
|
|
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
|
2015-11-15 22:39:06 +00:00
|
|
|
sys.modules.update({
|
2016-07-29 11:22:27 +00:00
|
|
|
"bpy.app": app,
|
|
|
|
"bpy.app.handlers": app.handlers,
|
|
|
|
"bpy.app.translations": app.translations,
|
|
|
|
"bpy.types": types,
|
|
|
|
})
|
2015-11-15 22:39:06 +00:00
|
|
|
|
|
|
|
# Initializes Python classes.
|
|
|
|
# (good place to run a profiler or trace).
|
2023-09-05 01:35:14 +00:00
|
|
|
# Postpone loading `extensions` scripts (add-ons & app-templates),
|
|
|
|
# until after the key-maps have been initialized.
|
|
|
|
utils.load_scripts(extensions=False)
|
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
|