Skip to content

ayon_equalizer

AYON Equalizer Addon.

EqualizerAddon

Bases: AYONAddon, IHostAddon

3DEqualizer Addon for AYON.

Source code in client/ayon_equalizer/addon.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class EqualizerAddon(AYONAddon, IHostAddon):
    """3DEqualizer Addon for AYON."""

    name = "equalizer"
    host_name = "equalizer"
    version = __version__
    heartbeat = 100

    def initialize(self, settings: dict[str, Any]) -> None:
        """Initialize Equalizer Addon."""
        self.heartbeat = settings["equalizer"]["heartbeat_interval"]
        self.enabled = True

    def add_implementation_envs(self, env: dict, _app: Any) -> None:  # noqa: ANN401
        """Add 3DEqualizer specific environment variables.

        3DEqualizer utilizes TDE4_ROOT for its root directory
        and PYTHON_CUSTOM_SCRIPTS_3DE4 as a colon-separated list of
        directories to look for additional python scripts.
        (Windows: list is separated by semicolons).

        Arguments:
            env (dict): Environment variables.
            _app (str): Application name.

        """
        startup_path = os.path.join(EQUALIZER_HOST_DIR, "startup")
        if "PYTHON_CUSTOM_SCRIPTS_3DE4" in env:
            startup_path = os.path.join(
                env["PYTHON_CUSTOM_SCRIPTS_3DE4"],
                startup_path)

        env["PYTHON_CUSTOM_SCRIPTS_3DE4"] = startup_path
        env["AYON_TDE4_HEARTBEAT_INTERVAL"] = str(self.heartbeat)

    def get_launch_hook_paths(self) -> list[str]:
        """Get paths to launch hooks."""
        return [os.path.join(EQUALIZER_HOST_DIR, "hooks")]

    def get_workfile_extensions(self) -> list[str]:
        """Get workfile extensions."""
        return [".3de"]

add_implementation_envs(env, _app)

Add 3DEqualizer specific environment variables.

3DEqualizer utilizes TDE4_ROOT for its root directory and PYTHON_CUSTOM_SCRIPTS_3DE4 as a colon-separated list of directories to look for additional python scripts. (Windows: list is separated by semicolons).

Parameters:

Name Type Description Default
env dict

Environment variables.

required
_app str

Application name.

required
Source code in client/ayon_equalizer/addon.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def add_implementation_envs(self, env: dict, _app: Any) -> None:  # noqa: ANN401
    """Add 3DEqualizer specific environment variables.

    3DEqualizer utilizes TDE4_ROOT for its root directory
    and PYTHON_CUSTOM_SCRIPTS_3DE4 as a colon-separated list of
    directories to look for additional python scripts.
    (Windows: list is separated by semicolons).

    Arguments:
        env (dict): Environment variables.
        _app (str): Application name.

    """
    startup_path = os.path.join(EQUALIZER_HOST_DIR, "startup")
    if "PYTHON_CUSTOM_SCRIPTS_3DE4" in env:
        startup_path = os.path.join(
            env["PYTHON_CUSTOM_SCRIPTS_3DE4"],
            startup_path)

    env["PYTHON_CUSTOM_SCRIPTS_3DE4"] = startup_path
    env["AYON_TDE4_HEARTBEAT_INTERVAL"] = str(self.heartbeat)

get_launch_hook_paths()

Get paths to launch hooks.

Source code in client/ayon_equalizer/addon.py
52
53
54
def get_launch_hook_paths(self) -> list[str]:
    """Get paths to launch hooks."""
    return [os.path.join(EQUALIZER_HOST_DIR, "hooks")]

get_workfile_extensions()

Get workfile extensions.

Source code in client/ayon_equalizer/addon.py
56
57
58
def get_workfile_extensions(self) -> list[str]:
    """Get workfile extensions."""
    return [".3de"]

initialize(settings)

Initialize Equalizer Addon.

Source code in client/ayon_equalizer/addon.py
25
26
27
28
def initialize(self, settings: dict[str, Any]) -> None:
    """Initialize Equalizer Addon."""
    self.heartbeat = settings["equalizer"]["heartbeat_interval"]
    self.enabled = True