Skip to content

settings

ExtractProductResourcesModel

Bases: BaseSettingsModel

Extract Product Resources.

Source code in server/settings.py
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
class ExtractProductResourcesModel(BaseSettingsModel):
    """Extract Product Resources.
    """
    profiles: list[ProductResourcesPresetModel] = SettingsField(
        default_factory=list,
        title="Profiles",
        description=(
            "Additional product resources profiles to be used in product "
            "resource extraction."
        )
    )

    @validator("profiles")
    def validate_profile_names(cls, value):
        # Assign a default name to unnamed profiles using the first free
        # number for its product base type, e.g. 'Plate Profile #2'
        labels = {
            "plate": "Plate Profile",
            "editorial_pkg": "Editorial PKG Profile",
        }
        used_names = {profile.name for profile in value if profile.name}
        for profile in value:
            label = labels.get(profile.product_base_type)
            if profile.name or label is None:
                continue
            idx = 1
            while f"{label} #{idx}" in used_names:
                idx += 1
            profile.name = f"{label} #{idx}"
            used_names.add(profile.name)

        ensure_unique_names(value)
        return value

MetadataMappingModel

Bases: BaseSettingsModel

Metadata mapping

Representation document context data are used for formatting of anatomy tokens. Following are supported: - version - task - asset

Source code in server/settings.py
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
class MetadataMappingModel(BaseSettingsModel):
    """Metadata mapping

    Representation document context data are used for formatting of
    anatomy tokens. Following are supported:
    - version
    - task
    - asset

    """
    name: str = SettingsField(
        "",
        title="Metadata property name"
    )
    value: str = SettingsField(
        "",
        title="Metadata value template"
    )

ProductResourcesPresetModel

Bases: BaseSettingsModel

Product Resources Preset.

Source code in server/settings.py
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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
class ProductResourcesPresetModel(BaseSettingsModel):
    """Product Resources Preset."""
    name: str = SettingsField(
        "",
        title="Profile Name",
        description=(
            "The name of the profile. If left empty, "
            "a default name based on selected product base type will be assigned on save. "
            "No further logic is connected to this."
        )
    )
    task_types: list[str] = SettingsField(
        default_factory=list,
        title="Task Types",
        enum_resolver=task_types_enum,
        section="Profile Filtering",
    )
    task_names: list[str] = SettingsField(
        default_factory=list,
        title="Task Names"
    )
    product_base_type: str = SettingsField(
        "editorial_pkg",
        title="Product Base Type",
        enum_resolver=_product_base_types_enum,
        conditional_enum=True
    )
    integrate_clip_source: bool = SettingsField(
        False,
        title="Integrate Clip Source",
        description=(
            "When enabled integrate the timeline item's media pool item as additional representation."
        )
    )

    # conditional properties based on product_base_type
    editorial_pkg: list[EditorialPKGModel] = SettingsField(
        default_factory=list,
        title="Output Definitions",
        description="Configures Resolve render settings for each representation to be exported."
    )
    plate: list[PlateModel] = SettingsField(
        default_factory=list,
        title="Output Definitions",
        description="Configures Resolve render settings for each representation to be exported."
    )

    @validator("editorial_pkg", "plate")
    def validate_unique_outputs(cls, value):
        # ensure_unique_names unfortunately is hardcoded to use `name` as field key
        names = []
        for val in value:
            if val.shared.repre_name in names:
                raise ValueError(f"Duplicate representation name: {val.shared.repre_name}")
            names.append(val.shared.repre_name)

        return value