Skip to content

startup

This script is used as a startup script in Resolve through a .scriptlib file

It triggers directly after the launch of Resolve and it's recommended to keep it optimized for fast performance since the Resolve UI is actually interactive while this is running. As such, there's nothing ensuring the user isn't continuing manually before any of the logic here runs. As such we also try to delay any imports as much as possible.

This code runs in a separate process to the main Resolve process.

ensure_installed_host()

Install resolve host with openpype and return the registered host.

This function can be called multiple times without triggering an additional install.

Source code in client/ayon_resolve/startup.py
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def ensure_installed_host():
    """Install resolve host with openpype and return the registered host.

    This function can be called multiple times without triggering an
    additional install.
    """
    from ayon_core.pipeline import install_host, registered_host
    host = registered_host()
    if host:
        return host

    host = ayon_resolve.api.ResolveHost()
    install_host(host)
    return registered_host()