Skip to content

main

FolderReparentingRelocateModel

Bases: BaseSettingsModel

Re-parent folders with Root relocation

Source code in server/settings/main.py
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
class FolderReparentingRelocateModel(BaseSettingsModel):
    """Re-parent folders with Root relocation"""
    enabled: bool = SettingsField(
        False,
        title="Enabled",
        description="Enable or disable the re-parenting",
    )

    presets: list[FolderReparentingPresetsModel] = SettingsField(
        title="Presets",
        default_factory=list,
        description=(
            "List of presets for re-parenting. "
            "If empty default behavior will be used."
        ),
    )

FolderReparentingTypeGroupingModel

Bases: BaseSettingsModel

Re-parent folders with Type grouping

Source code in server/settings/main.py
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
class FolderReparentingTypeGroupingModel(BaseSettingsModel):
    """Re-parent folders with Type grouping"""
    enabled: bool = SettingsField(
        False,
        title="Enabled",
        description="Enable or disable the re-parenting",
    )

    presets: list[FolderReparentingPresetsModel] = SettingsField(
        title="Presets",
        default_factory=list,
        description=(
            "List of presets for re-parenting. "
            "If empty default behavior will be used."
        ),
    )

ShotgridCompatibilitySettings

Bases: BaseSettingsModel

Settings to define relationships between ShotGrid and AYON.

Source code in server/settings/main.py
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
class ShotgridCompatibilitySettings(BaseSettingsModel):
    """Settings to define relationships between ShotGrid and AYON."""

    default_task_type: str = SettingsField(
        default="Generic",
        title="Default Task Type",
        enum_resolver=task_types_enum,
        description=("Default Task Type for SG tasks with missing pipeline step"),
    )
    shotgrid_enabled_entities: list[str] = SettingsField(
        title="ShotGrid Enabled Entities",
        default_factory=default_shotgrid_enabled_entities,
        enum_resolver=default_shotgrid_entities,
        description=(
            "The Entities that are enabled in ShotGrid, disable "
            "any that you do not use."
        ),
    )

    custom_attribs_map: list[AttributesMappingModel] = SettingsField(
        title="Folder Attributes Map",
        default_factory=get_default_folder_attributes,
        description=(
            "AYON attributes <> ShotGrid fields (without 'sg_' prefix!) "
            "mapping. Empty ones will be ignored. Scope is the list of "
            "ShotGrid entities that the mapping applies to. Disable any."
        ),
    )

    folder_parenting: FolderReparentingModel = SettingsField(
        title="Folder re-parenting",
        default_factory=FolderReparentingModel,
        description=("Parent folders for AYON folders matching to SG types."),
    )

ShotgridServiceSettings

Bases: BaseSettingsModel

Specific settings for the ShotGrid Services: Processor, Leecher and Transmitter.

The different services process events from either ShotGrid or AYON, this field allows to control how long to wait between each event is processed.

Source code in server/settings/main.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
class ShotgridServiceSettings(BaseSettingsModel):
    """Specific settings for the ShotGrid Services: Processor, Leecher and
    Transmitter.

    The different services process events from either ShotGrid or AYON,
    this field allows to control how long to wait between each event
    is processed.
    """
    polling_frequency: int = SettingsField(
        default=10,
        title="How often (in seconds) to process ShotGrid related events.",
        validate_default=False,
    )

    script_key: str = SettingsField(
        default="",
        enum_resolver=secrets_enum,
        title="ShotGrid's Script api key",
        description=(
            "AYON Secret used for Service related server operations "
            "Secret should lead to ShotGrid's Script api key. "
            "See more at: https://developer.shotgridsoftware.com/python-api/"
            "authentication.html#setting-up-shotgrid"
        ),
    )

    script_name: str = SettingsField(
        default="",
        placeholder="Create and Paste a script name here",
        title="ShotGrid's Script Name",
        description=(
            "AYON Secret used for Service related server operations "
            "Secret should lead to ShotGrid's Script Name. "
            "See more at: https://developer.shotgridsoftware.com/python-api/"
            "authentication.html#setting-up-shotgrid"
        ),
    )

ShotgridSettings

Bases: BaseSettingsModel

ShotGrid integration settings.

Main setting for the AYON x ShotGrid integration, these need to be filled out in order to for the services to correctly operate.

Source code in server/settings/main.py
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
class ShotgridSettings(BaseSettingsModel):
    """ShotGrid integration settings.

    Main setting for the AYON x ShotGrid integration, these need to be filled
    out in order to for the services to correctly operate.
    """

    shotgrid_server: str = SettingsField(
        default="",
        title="ShotGrid URL",
        description="The URL to the ShotGrid Server we want to interact with.",
        example="https://my-site.shotgrid.autodesk.com",
        scope=["studio"]
    )
    client_login: ClientLoginModel = SettingsField(
        default_factory=ClientLoginModel,
        title="Client login settings",
        scope=["studio"],
        section="---",
    )
    shotgrid_project_code_field: str = SettingsField(
        default="code",
        title="ShotGrid Project Code field name",
        description=(
            "In order to create AYON projects, we need a Project Code, you "
            "can specify here which field in the ShotGrid Project "
            "entity represents it."
        ),
        example="sg_code",
        scope=["studio"],
    )
    enable_shotgrid_local_storage: bool = SettingsField(
        default=True,
        title="Enable ShotGrid Local Storage.",
        description=(
            "Whether to try make use of local storage defined in ShotGrid "
            "('Site Preferences -> File Management -> Local Storage') or not."
        ),
        scope=["studio"],
    )
    shotgrid_local_storage_key: str = SettingsField(
        default="primary",
        title="ShotGrid Local Storage entry name",
        description=(
            "Name of the 'code' to select which one of the multiple "
            "possible local storages entries to use."
        ),
        example="ayon_storage",
        scope=["studio"],
    )
    anatomy_preset: str = SettingsField(
        default="_",
        title="Anatomy Preset",
        description=(
            "The anatomy preset to use for the "
            "ShotGrid synchronized projects."
        ),
        enum_resolver=anatomy_presets_enum
    )
    compatibility_settings: ShotgridCompatibilitySettings = SettingsField(
        default_factory=ShotgridCompatibilitySettings,
        title="ShotGrid <-> AYON compatibility Settings",
        description=(
            "All the settings that allow us to fine-grain the relation "
            "between ShotGrid and AYON entities."
        )
    )
    service_settings: ShotgridServiceSettings = SettingsField(
        default_factory=ShotgridServiceSettings,
        title="Service settings",
        scope=["studio"],
    )

default_shotgrid_enabled_entities()

The entity types in ShotGrid that are enabled by default in AYON.

Source code in server/settings/main.py
26
27
28
29
30
31
32
33
34
35
36
37
def default_shotgrid_enabled_entities():
    """The entity types in ShotGrid that are enabled by default in AYON."""
    return [
        "Project",
        "Episode",
        "Sequence",
        "Shot",
        "Asset",
        "Task",
        "Version",
        "Note"
    ]

default_shotgrid_entities()

The entity types that exist in ShotGrid.

Source code in server/settings/main.py
11
12
13
14
15
16
17
18
19
20
21
22
23
def default_shotgrid_entities():
    """The entity types that exist in ShotGrid."""
    return [
        "Project",
        "Episode",
        "Sequence",
        "Scene",
        "Shot",
        "Asset",
        "Task",
        "Version",
        "Note"
    ]

default_shotgrid_reparenting_entities()

The entity types in ShotGrid that are enabled by default in AYON.

Source code in server/settings/main.py
40
41
42
43
44
45
46
47
def default_shotgrid_reparenting_entities():
    """The entity types in ShotGrid that are enabled by default in AYON."""
    return [
        "Episode",
        "Sequence",
        "Shot",
        "Asset",
    ]

get_default_folder_attributes()

Get AYON's Folder attributes

Get all the attribs for Folder entities in a list to be consumed by the default_factory in the ShotgridCompatibilitySettings.custom_attribs_map settings.

Source code in server/settings/main.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
def get_default_folder_attributes():
    """Get AYON's Folder attributes

    Get all the `attribs` for Folder entities in a list
    to be consumed by the `default_factory` in the
    `ShotgridCompatibilitySettings.custom_attribs_map`
    settings.
    """
    attributes = []

    for attr_dict in attribute_library.data.get("folder", {}):
        attr_name = attr_dict["name"]

        if attr_name in ["shotgridId", "shotgridType", "tools"]:
            continue

        attr_map = {
            "ayon": attr_name,
            "sg": "",
            "type": attr_dict["type"],
            "scope": default_shotgrid_enabled_entities()
        }

        if attr_map not in attributes:
            attributes.append(attr_map)

    return attributes