mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge remote-tracking branch 'origin/feature/909-define-basic-trait-type-using-dataclasses' into feature/911-new-traits-based-integrator
This commit is contained in:
commit
8966c33bdd
4 changed files with 30 additions and 7 deletions
|
|
@ -12,7 +12,7 @@ from .content import (
|
|||
)
|
||||
from .cryptography import DigitallySigned, GPGSigned
|
||||
from .lifecycle import Persistent, Transient
|
||||
from .meta import Tagged, TemplatePath
|
||||
from .meta import Tagged, TemplatePath, Variant
|
||||
from .representation import Representation
|
||||
from .three_dimensional import Geometry, IESProfile, Lighting, Shader, Spatial
|
||||
from .time import (
|
||||
|
|
@ -71,6 +71,7 @@ __all__ = [
|
|||
# meta
|
||||
"Tagged",
|
||||
"TemplatePath",
|
||||
"Variant",
|
||||
|
||||
# two-dimensional
|
||||
"Compressed",
|
||||
|
|
|
|||
|
|
@ -51,3 +51,25 @@ class TemplatePath(TraitBase):
|
|||
id: ClassVar[str] = "ayon.meta.TemplatePath.v1"
|
||||
template: str = Field(..., title="Template Path")
|
||||
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")
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ class TraitBase(ABC, BaseModel):
|
|||
)
|
||||
)
|
||||
|
||||
persitent: bool = Field(
|
||||
default=True, title="Persitent",
|
||||
persistent: bool = Field(
|
||||
default=True, title="Persistent",
|
||||
description="Whether the trait is persistent (integrated) or not.")
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -21,18 +21,18 @@ REPRESENTATION_DATA = {
|
|||
"file_path": Path("/path/to/file"),
|
||||
"file_size": 1024,
|
||||
"file_hash": None,
|
||||
"persitent": True,
|
||||
"persistent": True,
|
||||
},
|
||||
Image.id: {"persitent": True},
|
||||
Image.id: {"persistent": True},
|
||||
PixelBased.id: {
|
||||
"display_window_width": 1920,
|
||||
"display_window_height": 1080,
|
||||
"pixel_aspect_ratio": 1.0,
|
||||
"persitent": True,
|
||||
"persistent": True,
|
||||
},
|
||||
Planar.id: {
|
||||
"planar_configuration": "RGB",
|
||||
"persitent": True,
|
||||
"persistent": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue