🎨 add Variant trait

This commit is contained in:
Ondrej Samohel 2024-12-03 17:37:45 +01:00
parent 828c522b10
commit e83541abdc
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 24 additions and 1 deletions

View file

@ -12,7 +12,7 @@ from .content import (
) )
from .cryptography import DigitallySigned, GPGSigned from .cryptography import DigitallySigned, GPGSigned
from .lifecycle import Persistent, Transient from .lifecycle import Persistent, Transient
from .meta import Tagged, TemplatePath from .meta import Tagged, TemplatePath, Variant
from .representation import Representation from .representation import Representation
from .three_dimensional import Geometry, IESProfile, Lighting, Shader, Spatial from .three_dimensional import Geometry, IESProfile, Lighting, Shader, Spatial
from .time import ( from .time import (
@ -71,6 +71,7 @@ __all__ = [
# meta # meta
"Tagged", "Tagged",
"TemplatePath", "TemplatePath",
"Variant",
# two-dimensional # two-dimensional
"Compressed", "Compressed",

View file

@ -51,3 +51,25 @@ class TemplatePath(TraitBase):
id: ClassVar[str] = "ayon.meta.TemplatePath.v1" id: ClassVar[str] = "ayon.meta.TemplatePath.v1"
template: str = Field(..., title="Template Path") template: str = Field(..., title="Template Path")
data: dict = Field(..., title="Formatting Data") data: dict = Field(..., title="Formatting Data")
class Variant(TraitBase):
"""Variant trait model.
This model represents a variant of the representation.
Example::
Variant(variant="high")
Variant(variant="prores444)
Attributes:
name (str): Trait name.
description (str): Trait description.
id (str): id should be namespaced trait name with version
variant (str): Variant name.
"""
name: ClassVar[str] = "Variant"
description: ClassVar[str] = "Variant Trait Model"
id: ClassVar[str] = "ayon.meta.Variant.v1"
variant: str = Field(..., title="Variant")