Skip to content

settings

get_ayon_settings(project_name=None)

AYON studio settings.

Raw AYON settings values.

Parameters:

Name Type Description Default
project_name Optional[str]

Project name.

None

Returns:

Type Description

dict[str, Any]: AYON settings.

Source code in client/ayon_core/settings/lib.py
126
127
128
129
130
131
132
133
134
135
136
137
138
def get_ayon_settings(project_name=None):
    """AYON studio settings.

    Raw AYON settings values.

    Args:
        project_name (Optional[str]): Project name.

    Returns:
        dict[str, Any]: AYON settings.
    """

    return _AyonSettingsCache.get_value_by_project(project_name)

get_current_project_settings()

Project settings for current context project.

Project name should be stored in environment variable AYON_PROJECT_NAME. This function should be used only in host context where environment variable must be set and should not happen that any part of process will change the value of the environment variable.

Source code in client/ayon_core/settings/lib.py
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
def get_current_project_settings():
    """Project settings for current context project.

    Project name should be stored in environment variable `AYON_PROJECT_NAME`.
    This function should be used only in host context where environment
    variable must be set and should not happen that any part of process will
    change the value of the environment variable.
    """
    project_name = os.environ.get("AYON_PROJECT_NAME")
    if not project_name:
        raise ValueError(
            "Missing context project in environment"
            " variable `AYON_PROJECT_NAME`."
        )
    return get_project_settings(project_name)

get_general_environments(studio_settings=None)

General studio environment variables.

Parameters:

Name Type Description Default
studio_settings Optional[dict]

Pre-queried studio settings.

None

Returns:

Type Description

dict[str, Any]: General studio environment variables.

Source code in client/ayon_core/settings/lib.py
149
150
151
152
153
154
155
156
157
158
159
160
161
def get_general_environments(studio_settings=None):
    """General studio environment variables.

    Args:
        studio_settings (Optional[dict]): Pre-queried studio settings.

    Returns:
        dict[str, Any]: General studio environment variables.

    """
    if studio_settings is None:
        studio_settings = get_ayon_settings()
    return json.loads(studio_settings["core"]["environments"])