Merge pull request #112 from tokejepsen/feature/studio_plugins

Feature/studio plugins
This commit is contained in:
Milan Kolar 2020-05-04 18:18:29 +02:00 committed by GitHub
commit 34c69cd9cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ log = logging.getLogger(__name__)
PROJECT_PLUGINS_PATH = os.environ.get("PYPE_PROJECT_PLUGINS")
STUDIO_PLUGINS_PATH = os.environ.get("PYPE_STUDIO_PLUGINS")
PACKAGE_DIR = os.path.dirname(__file__)
PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins")
@ -83,6 +84,20 @@ def install():
pyblish.register_plugin_path(plugin_path)
avalon.register_plugin_path(avalon.Loader, plugin_path)
avalon.register_plugin_path(avalon.Creator, plugin_path)
avalon.register_plugin_path(
avalon.InventoryAction, plugin_path
)
# Register studio specific plugins
if STUDIO_PLUGINS_PATH and project_name:
for path in STUDIO_PLUGINS_PATH.split(os.pathsep):
if not path:
continue
if os.path.exists(path):
pyblish.register_plugin_path(path)
avalon.register_plugin_path(avalon.Loader, path)
avalon.register_plugin_path(avalon.Creator, path)
avalon.register_plugin_path(avalon.InventoryAction, path)
# apply monkey patched discover to original one
avalon.discover = patched_discover