install creator plugins from modules on openpype plugin install

This commit is contained in:
Jakub Trllo 2022-05-13 11:47:03 +02:00
parent d2afd26ff6
commit 29cbc12ca8

View file

@ -12,7 +12,7 @@ import pyblish.api
from pyblish.lib import MessageHandler
import openpype
from openpype.modules import load_modules
from openpype.modules import load_modules, ModulesManager
from openpype.settings import get_project_settings
from openpype.lib import (
Anatomy,
@ -107,7 +107,7 @@ def install_host(host):
install_openpype_plugins()
def install_openpype_plugins(project_name=None):
def install_openpype_plugins(project_name=None, host_name=None):
# Make sure modules are loaded
load_modules()
@ -116,6 +116,14 @@ def install_openpype_plugins(project_name=None):
pyblish.api.register_discovery_filter(filter_pyblish_plugins)
register_loader_plugin_path(LOAD_PATH)
if host_name is None:
host_name = os.environ.get("AVALON_APP")
modules_manager = ModulesManager()
creator_paths = modules_manager.collect_creator_plugin_paths(host_name)
for creator_path in creator_paths:
register_creator_plugin_path(creator_path)
if project_name is None:
project_name = os.environ.get("AVALON_PROJECT")