예제 #1
0
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()
예제 #2
0
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()
예제 #3
0
    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()
예제 #4
0
파일: publish.py 프로젝트: 3dzayn/pype
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()
예제 #5
0
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"
예제 #6
0
 def __init__(self):
     super(ThisTestGUI, self).__init__()
     # Registers openpype's Global pyblish plugins
     openpype.install()
     # activate resolve from openpype
     avalon.install(bmdvr)
예제 #7
0
def main(env):
    import openpype.hosts.resolve as bmdvr
    # Registers openpype's Global pyblish plugins
    openpype.install()
    bmdvr.setup(env)