mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Add settings for effect categories
This commit is contained in:
parent
e9387c1b28
commit
dcf8805cfe
1 changed files with 32 additions and 2 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
from pydantic import Field
|
from pydantic import Field, validator
|
||||||
from ayon_server.settings import BaseSettingsModel
|
from ayon_server.settings import (
|
||||||
|
BaseSettingsModel, ensure_unique_names, normalize_name
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CollectInstanceVersionModel(BaseSettingsModel):
|
class CollectInstanceVersionModel(BaseSettingsModel):
|
||||||
|
|
@ -9,6 +11,30 @@ class CollectInstanceVersionModel(BaseSettingsModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class CollectClipEffectsDefModel(BaseSettingsModel):
|
||||||
|
_layout = "expanded"
|
||||||
|
name: str = Field("", title="Name")
|
||||||
|
effect_classes: list[str] = Field(
|
||||||
|
default_factory=list, title="Effect Classes"
|
||||||
|
)
|
||||||
|
|
||||||
|
@validator("name")
|
||||||
|
def validate_name(cls, value):
|
||||||
|
"""Ensure name does not contain weird characters"""
|
||||||
|
return normalize_name(value)
|
||||||
|
|
||||||
|
|
||||||
|
class CollectClipEffectsModel(BaseSettingsModel):
|
||||||
|
effect_categories: list[CollectClipEffectsDefModel] = Field(
|
||||||
|
default_factory=list, title="Effect Categories"
|
||||||
|
)
|
||||||
|
|
||||||
|
@validator("effect_categories")
|
||||||
|
def validate_unique_outputs(cls, value):
|
||||||
|
ensure_unique_names(value)
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
class ExtractReviewCutUpVideoModel(BaseSettingsModel):
|
class ExtractReviewCutUpVideoModel(BaseSettingsModel):
|
||||||
enabled: bool = Field(
|
enabled: bool = Field(
|
||||||
True,
|
True,
|
||||||
|
|
@ -25,6 +51,10 @@ class PublishPuginsModel(BaseSettingsModel):
|
||||||
default_factory=CollectInstanceVersionModel,
|
default_factory=CollectInstanceVersionModel,
|
||||||
title="Collect Instance Version"
|
title="Collect Instance Version"
|
||||||
)
|
)
|
||||||
|
CollectClipEffects: CollectClipEffectsModel = Field(
|
||||||
|
default_factory=CollectClipEffectsModel,
|
||||||
|
title="Collect Clip Effects"
|
||||||
|
)
|
||||||
"""# TODO: enhance settings with host api:
|
"""# TODO: enhance settings with host api:
|
||||||
Rename class name and plugin name
|
Rename class name and plugin name
|
||||||
to match title (it makes more sense)
|
to match title (it makes more sense)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue