def main(env): import openpype.hosts.resolve as bmdvr # Registers openpype's Global pyblish plugins openpype.install() # activate resolve from openpype avalon.install(bmdvr) log.info(f"Avalon registred hosts: {avalon.registered_host()}") bmdvr.launch_pype_menu()
def main(env): from openpype.hosts.fusion.api import menu import avalon.fusion # Registers pype's Global pyblish plugins openpype.install() # activate resolve from pype avalon.api.install(avalon.fusion) log.info(f"Avalon registred hosts: {avalon.api.registered_host()}") menu.launch_openpype_menu()
def publish(paths): """Start headless publishing. Publish use json from passed paths argument. Args: paths (list): Paths to jsons. Raises: RuntimeError: When there is no pathto process. """ if not any(paths): raise RuntimeError("No publish paths specified") from openpype import install, uninstall from openpype.api import Logger # Register target and host import pyblish.api import pyblish.util env = get_app_environments_for_context(os.environ["AVALON_PROJECT"], os.environ["AVALON_ASSET"], os.environ["AVALON_TASK"], os.environ["AVALON_APP_NAME"]) os.environ.update(env) log = Logger.get_logger() install() pyblish.api.register_target("filesequence") pyblish.api.register_host("shell") os.environ["OPENPYPE_PUBLISH_DATA"] = os.pathsep.join(paths) log.info("Running publish ...") # Error exit as soon as any error occurs. error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}" for result in pyblish.util.publish_iter(): if result["error"]: log.error(error_format.format(**result)) uninstall() sys.exit(1) log.info("Publish finished.") uninstall()
def main(env): from avalon.tools import publish # Registers pype's Global pyblish plugins openpype.install() # Register additional paths addition_paths_str = env.get("PUBLISH_PATHS") or "" addition_paths = addition_paths_str.split(os.pathsep) for path in addition_paths: path = os.path.normpath(path) if not os.path.exists(path): continue pyblish.api.register_plugin_path(path) return publish.show()
def test_avalon_plugin_presets(monkeypatch, printer): openpype.install() api.register_host(Test()) api.register_plugin(api.Creator, MyTestCreator) plugins = api.discover(api.Creator) printer("Test if we got our test plugin") assert MyTestCreator in plugins for p in plugins: if p.__name__ == "MyTestCreator": printer("Test if we have overriden existing property") assert p.my_test_property == "B" printer("Test if we have overriden superclass property") assert p.active is False printer("Test if we have added new property") assert p.new_property == "new"
def __init__(self): super(ThisTestGUI, self).__init__() # Registers openpype's Global pyblish plugins openpype.install() # activate resolve from openpype avalon.install(bmdvr)
def main(env): import openpype.hosts.resolve as bmdvr # Registers openpype's Global pyblish plugins openpype.install() bmdvr.setup(env)