Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define basic trait type using dataclasses #909

Open
antirotor opened this issue Sep 23, 2024 · 0 comments · May be fixed by #979
Open

Define basic trait type using dataclasses #909

antirotor opened this issue Sep 23, 2024 · 0 comments · May be fixed by #979

Comments

@antirotor
Copy link
Member

antirotor commented Sep 23, 2024

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
  • displayWindowWidth
  • displayWindowHeight
  • pixelAspectRatio
*
Planar - * To distinguish from Deep 👇🏻
Deep - * For deep data
Compressed
  • compressionType
AYON we might need more properties
Overscan
  • width
  • height
AYON for over/underscan - total width PixelBased.displayWindowWidth + ###
threeDimensional Spatial
  • upAxis
  • handedness
  • metersPerUnit
* Family (type) trait
Geometry - *
Shader - *
Lighting - *
IESProfile - *
timeDomain FrameRanged
  • startFrame
  • endFrame
  • inFrame
  • outFrame
  • framesPerSecond
  • step
*
Static -
Handles
  • startHandle
  • endHandle
  • inclusive
AYON
color ColorManaged
  • colorspace
*
content LocatableContent
  • location
  • mimeType
  • isTemplated
* location is URI, isTemplated indicates that variables there needs to be expanded before load
LocatableBundle
  • locations
  • mimeTypes
  • isTemplated []
  • sizes
  • hashes
AYON for multiple files defining one singular representation
audio Audio - * Family (type) trait
SampleBased - *
cryptography DigitallySigned - AYON Family (type) trait
GPG
  • keyId
  • fingerprint
  • timestamp
AYON for GPG signatures

Example:

EXR Sequence can be described with following traits Image, PixelBased, Planar, FrameRanged, LocatableContent.

@antirotor antirotor added type: feature Adding something new and exciting to the product Backwards incompatible labels Sep 23, 2024
@antirotor antirotor self-assigned this Sep 23, 2024
@antirotor antirotor linked a pull request Oct 31, 2024 that will close this issue
@mkolar mkolar removed the type: feature Adding something new and exciting to the product label Nov 1, 2024
antirotor added a commit that referenced this issue Nov 4, 2024
sync traits declared in #909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants