mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Addons directory (#4893)
* Add addons directory * add addons dir to modules dirs automatically --------- Co-authored-by: iLLiCiTiT <jakub.trllo@gmail.com>
This commit is contained in:
parent
ce1e45f708
commit
ab357eb03e
3 changed files with 14 additions and 1 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -112,3 +112,9 @@ tools/run_eventserver.*
|
||||||
tools/dev_*
|
tools/dev_*
|
||||||
|
|
||||||
.github_changelog_generator
|
.github_changelog_generator
|
||||||
|
|
||||||
|
|
||||||
|
# Addons
|
||||||
|
########
|
||||||
|
/openpype/addons/*
|
||||||
|
!/openpype/addons/README.md
|
||||||
|
|
|
||||||
3
openpype/addons/README.md
Normal file
3
openpype/addons/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
This directory is for storing external addons that needs to be included in the pipeline when distributed.
|
||||||
|
|
||||||
|
The directory is ignored by Git, but included in the zip and installation files.
|
||||||
|
|
@ -311,6 +311,7 @@ def _load_modules():
|
||||||
# Look for OpenPype modules in paths defined with `get_module_dirs`
|
# Look for OpenPype modules in paths defined with `get_module_dirs`
|
||||||
# - dynamically imported OpenPype modules and addons
|
# - dynamically imported OpenPype modules and addons
|
||||||
module_dirs = get_module_dirs()
|
module_dirs = get_module_dirs()
|
||||||
|
|
||||||
# Add current directory at first place
|
# Add current directory at first place
|
||||||
# - has small differences in import logic
|
# - has small differences in import logic
|
||||||
current_dir = os.path.abspath(os.path.dirname(__file__))
|
current_dir = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
@ -318,8 +319,11 @@ def _load_modules():
|
||||||
module_dirs.insert(0, hosts_dir)
|
module_dirs.insert(0, hosts_dir)
|
||||||
module_dirs.insert(0, current_dir)
|
module_dirs.insert(0, current_dir)
|
||||||
|
|
||||||
|
addons_dir = os.path.join(os.path.dirname(current_dir), "addons")
|
||||||
|
module_dirs.append(addons_dir)
|
||||||
|
|
||||||
processed_paths = set()
|
processed_paths = set()
|
||||||
for dirpath in module_dirs:
|
for dirpath in frozenset(module_dirs):
|
||||||
# Skip already processed paths
|
# Skip already processed paths
|
||||||
if dirpath in processed_paths:
|
if dirpath in processed_paths:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue