forked from AcademySoftwareFoundation/OpenRV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RV as a participant using the new Live Review schema (AcademySoft…
…wareFoundation#602) ### Add RV as a participant using the new Live Review schema ### Summarize your change. The `read_otio_string` function was added to parse the OTIO object containing the timeline sent by the Review App when RV is joining a new session as a participant. Since the timeline contains some annotation fields, the annotation schema was added in order to let OTIO know that it is a known schema during the deserialization step. However, nothing is done with the annotations at this stage. ### Describe the reason for the change. This is the first step in adding back the new OTIO schema as the preferred way of communication between RV and the Review App. ### Describe what you have tested and on which operating system. Live review using the new schema was tested between a local Review App where the feature was enabled with https://creative-collab.dev.shotguncloud.com and RV on MacOS. --------- Signed-off-by: Éloïse Brosseau <[email protected]>
- Loading branch information
1 parent
abc3cb8
commit e055db3
Showing
5 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# ***************************************************************************** | ||
# Copyright 2024 Autodesk, Inc. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# ***************************************************************************** | ||
|
||
""" | ||
For our OTIO output to effectively interface with other programs | ||
using the OpenTimelineIO Python API, our custom schema need to be | ||
specified and registered with the API. | ||
As per OTIO documentation, a class such as this one must be created, | ||
the schema must be registered with a PluginManifest, and the path to that | ||
manifest must be added to $OTIO_PLUGIN_MANIFEST_PATH; then the schema | ||
is ready to be used. | ||
Example: | ||
myObject = otio.schemadef.Annotation.Annotation(name, visible, layers) | ||
""" | ||
|
||
import opentimelineio as otio | ||
|
||
|
||
@otio.core.register_type | ||
class Annotation(otio.schema.Effect): | ||
"""A schema for annotations.""" | ||
|
||
_serializable_label = "Annotation.1" | ||
_name = "Annotation" | ||
|
||
def __init__( | ||
self, name: str = "", visible: bool = True, layers: list | None = None | ||
) -> None: | ||
super().__init__(name=name, effect_name="Annotation.1") | ||
self.visible = visible | ||
self.layers = layers | ||
|
||
_visible = otio.core.serializable_field( | ||
"visible", required_type=bool, doc=("Visible: expects either true or false") | ||
) | ||
|
||
_layers = otio.core.serializable_field( | ||
"layers", required_type=list, doc=("Layers: expects a list of annotation types") | ||
) | ||
|
||
@property | ||
def layers(self) -> list: | ||
return self._layers | ||
|
||
@layers.setter | ||
def layers(self, val: list): | ||
self._layers = val | ||
|
||
def __str__(self) -> str: | ||
return f"Annotation({self.name}, {self.effect_name}, {self.visible}, {self.layers})" | ||
|
||
def __repr__(self) -> str: | ||
return f"otio.schema.Annotation(name={self.name!r}, effect_name={self.effect_name!r}, visible={self.visible!r}, layers={self.layers!r})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters