mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
changed usages of registered host and config
This commit is contained in:
parent
729131738a
commit
331f87bd15
5 changed files with 18 additions and 24 deletions
|
|
@ -48,8 +48,8 @@ from openpype.tools.publisher.window import PublisherWindow
|
|||
|
||||
def main():
|
||||
"""Main function for testing purposes."""
|
||||
import avalon.api
|
||||
import pyblish.api
|
||||
from openpype.pipeline import install_host
|
||||
from openpype.modules import ModulesManager
|
||||
from openpype.hosts.testhost import api as testhost
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ def main():
|
|||
for plugin_path in manager.collect_plugin_paths()["publish"]:
|
||||
pyblish.api.register_plugin_path(plugin_path)
|
||||
|
||||
avalon.api.install(testhost)
|
||||
install_host(testhost)
|
||||
|
||||
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
|
||||
app = QtWidgets.QApplication([])
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ class PypeCommands:
|
|||
RuntimeError: When there is no path to process.
|
||||
"""
|
||||
from openpype.modules import ModulesManager
|
||||
from openpype import install, uninstall
|
||||
from openpype.pipeline import install_openpype_plugins
|
||||
|
||||
from openpype.api import Logger
|
||||
from openpype.tools.utils.host_tools import show_publish
|
||||
from openpype.tools.utils.lib import qt_app_context
|
||||
|
|
@ -112,7 +113,7 @@ class PypeCommands:
|
|||
|
||||
log = Logger.get_logger()
|
||||
|
||||
install()
|
||||
install_openpype_plugins()
|
||||
|
||||
manager = ModulesManager()
|
||||
|
||||
|
|
@ -294,7 +295,8 @@ class PypeCommands:
|
|||
# Register target and host
|
||||
import pyblish.api
|
||||
import pyblish.util
|
||||
import avalon.api
|
||||
|
||||
from openpype.pipeline import install_host
|
||||
from openpype.hosts.webpublisher import api as webpublisher
|
||||
|
||||
log = PypeLogger.get_logger()
|
||||
|
|
@ -315,7 +317,7 @@ class PypeCommands:
|
|||
for target in targets:
|
||||
pyblish.api.register_target(target)
|
||||
|
||||
avalon.api.install(webpublisher)
|
||||
install_host(webpublisher)
|
||||
|
||||
log.info("Running publish ...")
|
||||
|
||||
|
|
|
|||
|
|
@ -608,14 +608,4 @@ def cli(args):
|
|||
# Store settings
|
||||
api.Session["AVALON_PROJECT"] = project
|
||||
|
||||
from avalon import pipeline
|
||||
|
||||
# Find the set config
|
||||
_config = pipeline.find_config()
|
||||
if hasattr(_config, "install"):
|
||||
_config.install()
|
||||
else:
|
||||
print("Config `%s` has no function `install`" %
|
||||
_config.__name__)
|
||||
|
||||
show()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use singleton approach with global functions (using helper anyway).
|
|||
import os
|
||||
import avalon.api
|
||||
import pyblish.api
|
||||
from openpype.pipeline import registered_host
|
||||
from .lib import qt_app_context
|
||||
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ class HostToolsHelper:
|
|||
Window, validate_host_requirements
|
||||
)
|
||||
# Host validation
|
||||
host = avalon.api.registered_host()
|
||||
host = registered_host()
|
||||
validate_host_requirements(host)
|
||||
|
||||
workfiles_window = Window(parent=parent)
|
||||
|
|
|
|||
|
|
@ -6,16 +6,17 @@ import collections
|
|||
from Qt import QtWidgets, QtCore, QtGui
|
||||
import qtawesome
|
||||
|
||||
import avalon.api
|
||||
|
||||
from openpype.style import get_default_entity_icon_color
|
||||
from openpype.style import (
|
||||
get_default_entity_icon_color,
|
||||
get_objected_colors,
|
||||
)
|
||||
from openpype.resources import get_image_path
|
||||
from openpype.lib import filter_profiles
|
||||
from openpype.api import (
|
||||
get_project_settings,
|
||||
Logger
|
||||
)
|
||||
from openpype.lib import filter_profiles
|
||||
from openpype.style import get_objected_colors
|
||||
from openpype.resources import get_image_path
|
||||
from openpype.pipeline import registered_host
|
||||
|
||||
log = Logger.get_logger(__name__)
|
||||
|
||||
|
|
@ -402,7 +403,7 @@ class FamilyConfigCache:
|
|||
|
||||
self.family_configs.clear()
|
||||
# Skip if we're not in host context
|
||||
if not avalon.api.registered_host():
|
||||
if not registered_host():
|
||||
return
|
||||
|
||||
# Update the icons from the project configuration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue