mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
install project specific plugins (publish, load and create) found in {PYPE_PROJECT_PLUGINS}/{project_name}
This commit is contained in:
parent
f2bca6ad1b
commit
8997da158a
1 changed files with 13 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ log = logging.getLogger(__name__)
|
|||
|
||||
__version__ = "2.5.0"
|
||||
|
||||
PROJECT_PLUGINS_PATH = os.environ.get("PYPE_PROJECT_PLUGINS")
|
||||
PACKAGE_DIR = os.path.dirname(__file__)
|
||||
PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins")
|
||||
|
||||
|
|
@ -72,6 +73,18 @@ def install():
|
|||
pyblish.register_discovery_filter(filter_pyblish_plugins)
|
||||
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)
|
||||
|
||||
# Register project specific plugins
|
||||
project_name = os.environ.get("AVALON_PROJECT")
|
||||
if PROJECT_PLUGINS_PATH and project_name:
|
||||
for path in PROJECT_PLUGINS_PATH.split(os.pathsep):
|
||||
if not path:
|
||||
continue
|
||||
plugin_path = os.path.join(path, project_name)
|
||||
if os.path.exists(plugin_path):
|
||||
pyblish.register_plugin_path(plugin_path)
|
||||
avalon.register_plugin_path(avalon.Loader, plugin_path)
|
||||
avalon.register_plugin_path(avalon.Creator, plugin_path)
|
||||
|
||||
# apply monkey patched discover to original one
|
||||
avalon.discover = patched_discover
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue