ayon-core
ayon-core copied to clipboard
Define basic trait type using dataclasses
[!NOTE] This is part Representation Schemas Epic effort
We need to define basic Trait types as Pydantic models or even just plain python dataclasses.
Traits are schemas/types thing to descibe expected properties of given representation. So if something has a path on storage, it defines the LocatableContent
trait with its property - path
. If it is also an image, it will define a PlanarImage
trait that has things like resolutionWidth
and resolutionHeight
, etc.
Initial idea was to use OpenAssetIO and its Media Creation Traits and Specifications, but since we don't internally need to use OpenAssetIOn for asset resolution, we don't need the whole complexity and dependance on third party framework.
Some compatibility with OpenAssetIO traits can be maintained by having tool that will transform AYON dataclasses back to traits YAML files. This shouldn't be an issue if we either use same names for properties or create some mapping later on, bigger problem is limited type support in OpenAssetIO.
So what are the traits we need? This table isn't really complete, also be aware that media creation defined traits (marked with *
in the OpenAssetIO column might change during the time.
scope | name | properties | OpenAssetIO | note |
---|---|---|---|---|
twoDimensional | Image | - | * | Family (type) trait |
PixelBased |
|
* | ||
Planar | - | * | To distinguish from Deep 👇🏻 | |
Deep | - | * | For deep data | |
Compressed |
|
AYON | we might need more properties | |
Overscan |
|
AYON | for over/underscan - total width PixelBased.displayWindowWidth + ### |
|
threeDimensional | Spatial |
|
* | Family (type) trait |
Geometry | - | * | ||
Shader | - | * | ||
Lighting | - | * | ||
IESProfile | - | * | ||
timeDomain | FrameRanged |
|
* | |
Static | - | |||
Handles |
|
AYON | ||
color | ColorManaged |
|
* | |
content | LocatableContent |
|
* | location is URI, isTemplated indicates that variables there needs to be expanded before load |
LocatableBundle |
|
AYON | for multiple files defining one singular representation | |
audio | Audio | - | * | Family (type) trait |
SampleBased | - | * | ||
cryptography | DigitallySigned | - | AYON | Family (type) trait |
GPG |
|
AYON | for GPG signatures |
Example:
EXR Sequence can be described with following traits Image
, PixelBased
, Planar
, FrameRanged
, LocatableContent
.