Skip to content

ayon_openrv

OpenRVAddon

Bases: AYONAddon, IHostAddon, IPluginPaths

Source code in client/ayon_openrv/addon.py
10
11
12
13
14
15
16
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
class OpenRVAddon(AYONAddon, IHostAddon, IPluginPaths):
    name = "openrv"
    host_name = "openrv"
    version = __version__

    def get_plugin_paths(self):
        return {}

    def get_create_plugin_paths(self, host_name):
        if host_name != self.host_name:
            return []
        plugins_dir = os.path.join(OPENRV_ROOT_DIR, "plugins")
        return [os.path.join(plugins_dir, "create")]

    def get_publish_plugin_paths(self, host_name):
        if host_name != self.host_name:
            return []
        plugins_dir = os.path.join(OPENRV_ROOT_DIR, "plugins")
        return [os.path.join(plugins_dir, "publish")]

    def get_load_plugin_paths(self, host_name):
        loaders_dir = os.path.join(OPENRV_ROOT_DIR, "plugins", "load")
        if host_name != self.host_name:
            # Other hosts and tray browser
            return [os.path.join(loaders_dir, "global")]
        # inside OpenRV
        return [os.path.join(loaders_dir, "openrv")]

    def add_implementation_envs(self, env, app):
        """Modify environments to contain all required for implementation."""
        # Set default environments if are not set via settings
        defaults = {
            "AYON_LOG_NO_COLORS": "True"
        }
        for key, value in defaults.items():
            if not env.get(key):
                env[key] = value

    def get_launch_hook_paths(self, app):
        if app.host_name != self.host_name:
            return []
        return [
            os.path.join(OPENRV_ROOT_DIR, "hooks")
        ]

    def get_workfile_extensions(self):
        return [".rv"]

add_implementation_envs(env, app)

Modify environments to contain all required for implementation.

Source code in client/ayon_openrv/addon.py
38
39
40
41
42
43
44
45
46
def add_implementation_envs(self, env, app):
    """Modify environments to contain all required for implementation."""
    # Set default environments if are not set via settings
    defaults = {
        "AYON_LOG_NO_COLORS": "True"
    }
    for key, value in defaults.items():
        if not env.get(key):
            env[key] = value