mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added import of default modules
This commit is contained in:
parent
679c678fa3
commit
f12ef3aea8
1 changed files with 22 additions and 2 deletions
|
|
@ -271,9 +271,29 @@ def _load_modules():
|
|||
|
||||
log = PypeLogger.get_logger("ModulesLoader")
|
||||
|
||||
# Look for OpenPype modules in paths defined with `get_module_dirs`
|
||||
dirpaths = get_module_dirs()
|
||||
# Import default modules imported from 'openpype.modules'
|
||||
for default_module_name in (
|
||||
"settings_action",
|
||||
"launcher_action",
|
||||
"project_manager_action",
|
||||
"standalonepublish_action",
|
||||
):
|
||||
try:
|
||||
default_module = __import__(
|
||||
"openpype.modules.{}".format(default_module_name),
|
||||
fromlist=("", )
|
||||
)
|
||||
setattr(openpype_modules, default_module_name, default_module)
|
||||
|
||||
except Exception:
|
||||
msg = (
|
||||
"Failed to import default module '{}'."
|
||||
).format(default_module_name)
|
||||
log.error(msg, exc_info=True)
|
||||
|
||||
# Look for OpenPype modules in paths defined with `get_module_dirs`
|
||||
# - dynamically imported OpenPype modules and addons
|
||||
dirpaths = get_module_dirs()
|
||||
for dirpath in dirpaths:
|
||||
if not os.path.exists(dirpath):
|
||||
log.warning((
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue