Skip to content

Commit 8ba0786

Browse files
authored
Merge pull request OpenAssetIO#71 from foundrytom/work/22-prodTraits
Add Traits and Specifications for common production workflows
2 parents 916da78 + 62f2d52 commit 8ba0786

File tree

6 files changed

+1103
-19
lines changed

6 files changed

+1103
-19
lines changed

GUIDELINES.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Guidelines
2+
3+
This document covers general best-practices when authoring Traits and/or
4+
Specifications for inclusion in the library.
5+
6+
## Traits
7+
8+
Traits define unique qualities or characteristics of an Entity or
9+
Relationship.
10+
11+
- Traits must be atomic. No single trait should ever change the
12+
meaning of another trait _or its properties_. This ensures that future
13+
traits not known at the time code is written can't change the meaning
14+
of previously defined values.
15+
16+
- Traits should contain the minimum number of properties required to
17+
define a particular characteristic. They must document in their
18+
description if properties are optional. Non-optional properties are
19+
required to be populated by a host during publishing, and during
20+
resolve by a supporting manager.
21+
22+
- In order to facilitate identification, traits must define a single
23+
characteristic. Consider splitting 'optional' properties into a
24+
separate trait. For example the bounding box of a 3D object would be
25+
best expressed through the `BoundingBox` trait, rather than an
26+
optional `boundingBox` property of the `Spatial` trait.
27+
28+
- Traits should _not_ use properties to differentiate between different
29+
exhibited characteristics. Individual traits should be created for
30+
each one. Properties are then used to describe specific details of
31+
that quality. For example, instead of an `Animated` trait with a
32+
boolean `isAnimated` property, we have `Static` and `FrameRanged`
33+
traits. This ensures the _set of trait ids_ is sufficient to identify
34+
the qualities of an entity, and that the properties of these traits
35+
are then appropriate to each. Illustrated by the `startFrame` and
36+
`endFrame` of the `FrameRanged` trait - a future `TimeRanged` trait
37+
would naturally require different parameterisation.
38+
39+
- Effort should me made to ensure a minimal overlap between trait names.
40+
The namespace and package name can be leveraged in order to reduce
41+
ambiguity if necessary, avoiding the need to be truly unique within
42+
the ecosystem in all cases.
43+
44+
- Trait property names should describe the nature of the value as
45+
precisely as possible. They shouldn't require the user to consult the
46+
documentation. For example:
47+
- Good: `framesPerSecond`, `metersPerLinearUnit`
48+
- Bad: `frameRate`, `units`
49+
50+
- "Family" traits can be defined where applicable to allow high-level
51+
partitioning of entity space. For example the `Image` and `Spatial`
52+
traits exist solely to allow users to broadly filter 2D and 3D
53+
entities without needing multiple top-level trait sets. Care should be
54+
taken when defining properties for these traits, to ensure they are
55+
genuinely applicable to all entities with the quality in question. Eg.
56+
`Spatial` does not include a bounding box as there are many unbounded
57+
or zero-volume concepts in the 3D world, this should be expressed
58+
through a peer trait in the `threeDimensional` namespace that can be
59+
composed as needed.
60+
61+
- The absence of a trait _does not_ imply its inverse, and so companion
62+
traits may be needed to define antonyms or other mutually exclusive
63+
qualities
64+
65+
## Specifications
66+
67+
Specifications define well-known collections of traits that map to
68+
first-class concepts within our workflows. They are used to create a
69+
common definition of the nature of entities ("assets") and relationships
70+
between them. The collection of traits is known formally within the
71+
OpenAssetIO ecosystem as a "trait set".
72+
73+
- Specifications must contain the minimum number of traits required to
74+
define a particular concrete workflow entity. Trait sets are
75+
[additive](https://openassetio.github.io/OpenAssetIO/entities_traits_and_specifications.html#Specifications),
76+
and so each trait stipulates that the entity _must_ possess that
77+
quality, _in addition to_ the qualities of all the other traits in the
78+
set. There is no way to define a specification that states "one trait
79+
or the other".
80+
81+
- Effort should me made to ensure a minimal overlap between
82+
specification names. The namespace and package name can be leveraged
83+
in order to reduce ambiguity if necessary, avoiding the need to be
84+
truly unique within the ecosystem in all cases.
85+
86+
- Specifications that define a relationship should append `Relationship`
87+
to their names to help with cognition.
88+
89+
- "Family" specifications can be defined to allow high-level
90+
partitioning of entity space. For example the `Image` and `Spatial`
91+
specifications exist solely to allow users to broadly filter 2D and 3D
92+
entities without needing multiple top-level specifications. Care should be
93+
taken to ensure that their trait sets are not overly constrained to
94+
preclude future evolution. These specifications do not include the
95+
`LocatableContent` trait to ensure we can support inline Image or
96+
Spatial data (eg. a procedural checkerboard pattern), even though at
97+
the time of going to press, known workflows only used independent
98+
resource data.
99+
100+
- Specifications should form well-known base trait sets. They do not
101+
necessarily need to be exhaustively defined for all specialisations.
102+
Taking images as an example, we define bases for core variations of
103+
how they are encoded in our problem space (`PlanarBitmapImage`,
104+
`DeepBitmapImage`, etc). We do not define an exhaustive set of
105+
additional specifications for the matrix of images that are some
106+
combination of `Static`, `FrameRanged`, `OCIOColorManaged`. Users are
107+
encouraged to compose or resolve other meaningful traits with the
108+
well-known specifications as appropriate. Formally defining these
109+
"well-known combinations" in a non-limiting way is something to be
110+
investigated.
111+
112+
- All specifications must contain a single trait from the `usage`
113+
namespace to define their meaning when encountered at runtime.
114+
115+
- Care should be taken when composing traits to ensure
116+
that there is a specific trait present that defines each required
117+
quality, rather than relying on the omission of a contrary quality.
118+
The absence of a trait within a specification's trait set only means the
119+
set does not specify whether it exhibits that quality or not. This
120+
allows trait sets to be used as filter predicates:
121+
- `{ Entity, Image }`: All images (static, animated or any other).
122+
- `{ Entity, Image, Static }`: Only static images without animation.
123+
- `{ Entity, Image, FrameRanged }`: Only animated images that cover a
124+
discrete series of frames.
125+
126+
- Hosts and managers are encouraged to _extend_ well-known
127+
specifications with their own proprietary traits to sufficiently to
128+
differentiate from other entities. A common pattern for
129+
application-specific "documents" is to define a trait named after the
130+
application (eg.`Blender`) and compose this with existing Media
131+
Creation `Workfile` specification. This facilitates more generic
132+
handling via the well-known trait set, but achieve suitable filtering
133+
if needed when only the app-specific variant is required.
134+
135+
- **Hosts and managers are _strongly discouraged_ from only using
136+
proprietary traits in their specifications as it defeats
137+
interoperability.** Using custom traits require explicit support in
138+
every host _and_ manager, which limits compatibility between systems.

README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
# OpenAssetIO-MediaCreation
22

33
A library of OpenAssetIO extensions for use in Media Creation workflows.
4+
Covering images, three-dimenstional models, versioning, proxy
5+
relationships and more.
46

5-
> Note: This repository is currently in a pre-alpha state, and so should
6-
> not be used for any production critical applications.
7+
> **Warning:**
8+
> This repository is currently in a beta state, and so should
9+
> be used in production critical applications with caution.
710
811
Included are several well-known Traits and Specifications for use in
9-
OpenAssetIO hosts and managers. For more information on this mechanism,
10-
see the [OpenAssetIO docs](https://openassetio.github.io/OpenAssetIO).
12+
Digital Content Creation tools and wth Asset Management Systems found in
13+
the media production space. For more information on the Traits and
14+
Specifications mechanism, see the [OpenAssetIO
15+
docs](https://openassetio.github.io/OpenAssetIO).
1116

12-
MediaCreation is an automatically generated Python package,
17+
The project attempts to align with relevant industry standards wherever
18+
possible or appicable, incuding:
19+
20+
- The [MovieLabs Ontology](https://movielabs.com/production-technology/ontology-for-media-creation/).
21+
- The [OpenUSD data model](https://www.openusd.org).
22+
23+
MediaCreation is an automatically generated Python/C++ package,
1324
[openassetio-traitgen](https://github.com/OpenAssetIO/OpenAssetIO-TraitGen)
14-
is used to generate trait implementations based on [traits.yml](traits.yml)
25+
is used to generate trait implementations based on
26+
[traits.yml](traits.yml).
1527

1628
## Examples
1729

@@ -37,14 +49,17 @@ jupyter notebook
3749

3850
These initial incarnations of traits/specifications serve as
3951
illustrative examples to facilitate discussion and experimentation.
40-
Pending tasks:
52+
Pending tasks required to reach a stable `v1.0`:
4153

4254
- [x] Define YAML schema to represent traits/specifications.
4355
- [x] Auto-generate Python classes from YAML
4456
- [x] Auto-generate CPP classes from YAML
45-
- [ ] Auto-generate C classes from YAML.
46-
- [ ] Extend library to cover common post-production entities and
57+
- [x] Extend library to cover common post-production entities and
4758
locales.
59+
- [ ] Define how [change is managed](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/65)
60+
within the library.
61+
- [ ] Determine if there is a neccesary [mechanism for extending
62+
existing Specifications](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/65).
4863

4964
## Installation
5065

@@ -113,6 +128,7 @@ welcome!
113128

114129
When adding new Traits and Specifications:
115130

131+
0. Review the [guidelines](GUIDELINES.md)
116132
1. Update [traits.yml](traits.yml)
117133
2. Add an [import test](tests/python/openassetio_mediacreation/test_imports.py)
118134
3. Update the [RELEASE_NOTES](RELEASE_NOTES.md)

RELEASE_NOTES.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
Release Notes
22
=============
33

4-
v1.0.0-alpha.x
5-
--------------
4+
v1.0.0-beta.x
5+
---------------
6+
7+
### New features
8+
9+
- Added numerous Traits and Specifications for common post-production
10+
workflows.
11+
[#22](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/22)
612

713
### Breaking changes
814

@@ -27,6 +33,10 @@ v1.0.0-alpha.x
2733
this feature.
2834
[#58](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/58)
2935

36+
- Added `mimeType` and `isTemplated` properties to the
37+
`LocatableContentTrait` to aid loading of the referenced content.
38+
[#22](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/22)
39+
3040
v1.0.0-alpha.7
3141
--------------
3242

0 commit comments

Comments
 (0)