Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/tutorials/otio-serialized-schema-only-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ parameters:

## Module: opentimelineio.core

### Color.1

parameters:
- *a*
- *b*
- *g*
- *name*
- *r*

### Composable.1

parameters:
Expand Down
21 changes: 21 additions & 0 deletions docs/tutorials/otio-serialized-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ parameters:

## Module: opentimelineio.core

### Color.1

*full module path*: `opentimelineio.core.Color`

*documentation*:

```
:class:`Color` is a definition of red, green, blue, and alpha double floating point values, allowing
conversion between different formats. To be considered interoperable, the sRGB transfer function
encoded values, ranging between zero and one, are expected to be accurate to within 1/255 of the
intended value. Round-trip conversions may not be guaranteed outside that. This Color class is meant
for use in user interface elements, like marker or clip coloring, NOT for image pixel content.
```

parameters:
- *a*:
- *b*:
- *g*:
- *name*:
- *r*:

### Composable.1

*full module path*: `opentimelineio.core.Composable`
Expand Down
6 changes: 3 additions & 3 deletions src/opentimelineio/deserialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,13 @@ SerializableObject::Reader::_decode(_Resolver& resolver)
}
else if (schema_name_and_version == "Color.1")
{
float r, g, b, a;
double r, g, b, a;
std::string name;
return _fetch("r", &r)
return _fetch("name", &name)
&& _fetch("r", &r)
&& _fetch("g", &g)
&& _fetch("b", &b)
&& _fetch("a", &a)
&& _fetch("name", &name)
? std::any(Color(r, g, b, a, name))
: std::any();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def _generate_model_for_module(mod, classes, modules):
otio.opentime.RationalTime,
otio.opentime.TimeRange,
otio.opentime.TimeTransform,
otio.core.Color
)
)
]
Expand Down
1 change: 1 addition & 0 deletions src/py-opentimelineio/opentimelineio/core/_core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"opentime.RationalTime",
"opentime.TimeRange",
"opentime.TimeTransform",
"opentimelineio.core.Color",
"opentimelineio.core.SerializableObject"
)

Expand Down
4 changes: 4 additions & 0 deletions tests/test_json_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def test_timetransform(self):
tt = otio.opentime.TimeTransform()
self.check_against_baseline(tt, "empty_timetransform")

def test_color(self):
tt = otio.core.Color()
self.check_against_baseline(tt, "empty_color")

def test_track(self):
st = otio.schema.Track(
name="test_track",
Expand Down
Loading