Skip to content

Commit 1deda32

Browse files
authored
RV adapter metadata updates (#640)
* RV adapter now stores metadata under the 'otio.metadata' property instead of 'attributes.otio_metadata' * Switched RV adapter and plugin to using otio to seralize their metadata * Switch RV otio serialization to use an indent of -1 for compact writing Co-authored-by: Robyn Rindge <[email protected]>
1 parent f24279f commit 1deda32

File tree

7 files changed

+303
-74
lines changed

7 files changed

+303
-74
lines changed

contrib/opentimelineio_contrib/adapters/extern_rv.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,16 @@ def _create_media_reference(item, src, track_kind=None):
271271
def _write_item(it, to_session, track_kind=None):
272272
src = to_session.newNode("Source", str(it.name) or "clip")
273273

274-
src.setProperty(
275-
"RVSourceGroup",
276-
"source",
277-
"attributes",
278-
"otio_metadata",
279-
rvSession.gto.STRING, str(it.metadata)
280-
)
274+
if it.metadata:
275+
src.setProperty(
276+
"RVSourceGroup",
277+
"source",
278+
"otio",
279+
"metadata",
280+
rvSession.gto.STRING,
281+
# Serialize to a string as it seems gto has issues with unicode
282+
str(otio.core.serialize_json_to_string(it.metadata, indent=-1))
283+
)
281284

282285
range_to_read = it.trimmed_range()
283286

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"OTIO_SCHEMA": "Timeline.1",
3+
"metadata": {},
4+
"name": "OTIO_Test_ppjoshm1.Exported.01",
5+
"tracks": {
6+
"OTIO_SCHEMA": "Stack.1",
7+
"children": [
8+
{
9+
"OTIO_SCHEMA": "Track.1",
10+
"children": [
11+
{
12+
"OTIO_SCHEMA": "Clip.1",
13+
"effects": [],
14+
"markers": [],
15+
"media_reference": {
16+
"OTIO_SCHEMA": "ExternalReference.1",
17+
"available_range": {
18+
"OTIO_SCHEMA": "TimeRange.1",
19+
"duration": {
20+
"OTIO_SCHEMA": "RationalTime.1",
21+
"rate": 24,
22+
"value": 192
23+
},
24+
"start_time": {
25+
"OTIO_SCHEMA": "RationalTime.1",
26+
"rate": 24,
27+
"value": 1
28+
}
29+
},
30+
"metadata": {},
31+
"name": null,
32+
"target_url": "sample_data/one_clip.mov"
33+
},
34+
"metadata": {
35+
"cmx_3600": {
36+
"comments": [
37+
"SOURCE FILE: ZZ100_507C.LAY2.01"
38+
],
39+
"reel": "ZZ100_50"
40+
}
41+
},
42+
"name": "ppjoshm_1 (SIM1)",
43+
"source_range": {
44+
"OTIO_SCHEMA": "TimeRange.1",
45+
"duration": {
46+
"OTIO_SCHEMA": "RationalTime.1",
47+
"rate": 24.0,
48+
"value": 10
49+
},
50+
"start_time": {
51+
"OTIO_SCHEMA": "RationalTime.1",
52+
"rate": 24.0,
53+
"value": 101
54+
}
55+
}
56+
}
57+
],
58+
"effects": [],
59+
"kind": "Video",
60+
"markers": [],
61+
"metadata": {},
62+
"name": "TimelineMobSlot",
63+
"source_range": null
64+
},
65+
{
66+
"OTIO_SCHEMA": "Track.1",
67+
"children": [
68+
{
69+
"OTIO_SCHEMA": "Clip.1",
70+
"effects": [],
71+
"markers": [],
72+
"media_reference": {
73+
"OTIO_SCHEMA": "ExternalReference.1",
74+
"available_range": {
75+
"OTIO_SCHEMA": "TimeRange.1",
76+
"duration": {
77+
"OTIO_SCHEMA": "RationalTime.1",
78+
"rate": 24,
79+
"value": 192
80+
},
81+
"start_time": {
82+
"OTIO_SCHEMA": "RationalTime.1",
83+
"rate": 24,
84+
"value": 1
85+
}
86+
},
87+
"metadata": {},
88+
"name": null,
89+
"target_url": "sample_data/one_clip.mov"
90+
},
91+
"metadata": {
92+
"pixar": {
93+
"OTIO_SCHEMA": "PixarMetadata.1",
94+
"cache": {
95+
"hitech": {
96+
"OTIO_SCHEMA": "PixarHitech.1",
97+
"shot": null,
98+
"take": null
99+
}
100+
},
101+
"take": {
102+
"OTIO_SCHEMA": "PixarTake.1",
103+
"globaltake": 1,
104+
"prod": "ppjoshm",
105+
"shot": "ppjoshm_1",
106+
"unit": "none"
107+
}
108+
}
109+
},
110+
"name": "ppjoshm_1 (SIM1)",
111+
"source_range": {
112+
"OTIO_SCHEMA": "TimeRange.1",
113+
"duration": {
114+
"OTIO_SCHEMA": "RationalTime.1",
115+
"rate": 24.0,
116+
"value": 10
117+
},
118+
"start_time": {
119+
"OTIO_SCHEMA": "RationalTime.1",
120+
"rate": 24.0,
121+
"value": 0
122+
}
123+
}
124+
}
125+
],
126+
"effects": [],
127+
"kind": "Audio",
128+
"markers": [],
129+
"metadata": {},
130+
"name": "TimelineMobSlot",
131+
"source_range": null
132+
}
133+
],
134+
"effects": [],
135+
"markers": [],
136+
"metadata": {},
137+
"name": "tracks",
138+
"source_range": null
139+
}
140+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
GTOa (4)
2+
3+
rv : RVSession (4)
4+
{
5+
session
6+
{
7+
string viewNode = "Stack000000"
8+
}
9+
10+
writer
11+
{
12+
string name = "rvSession.py"
13+
string version = "0.5"
14+
}
15+
}
16+
17+
connections : connection (2)
18+
{
19+
evaluation
20+
{
21+
string[2] connections = [ [ "sourceGroup000001" "Sequence000001" ] [ "sourceGroup000000" "Sequence000000" ] [ "Sequence000000" "Stack000000" ] [ "Sequence000001" "Stack000000" ] ]
22+
}
23+
}
24+
25+
Sequence000000 : RVSequenceGroup (1)
26+
{
27+
ui
28+
{
29+
string name = "TimelineMobSlot"
30+
}
31+
}
32+
33+
Sequence000001 : RVSequenceGroup (1)
34+
{
35+
ui
36+
{
37+
string name = "TimelineMobSlot"
38+
}
39+
}
40+
41+
Stack000000 : RVStackGroup (1)
42+
{
43+
ui
44+
{
45+
string name = "tracks"
46+
}
47+
}
48+
49+
sourceGroup000000 : RVSourceGroup (1)
50+
{
51+
ui
52+
{
53+
string name = "ppjoshm_1 (SIM1)"
54+
}
55+
}
56+
57+
sourceGroup000000_source : RVFileSource (1)
58+
{
59+
cut
60+
{
61+
int in = 101
62+
int out = 110
63+
}
64+
65+
group
66+
{
67+
float fps = 24
68+
}
69+
70+
media
71+
{
72+
string movie = "sample_data/one_clip.mov"
73+
}
74+
75+
otio
76+
{
77+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_507C.LAY2.01\"],\"reel\":\"ZZ100_50\"}}"
78+
}
79+
}
80+
81+
sourceGroup000001 : RVSourceGroup (1)
82+
{
83+
ui
84+
{
85+
string name = "ppjoshm_1 (SIM1)"
86+
}
87+
}
88+
89+
sourceGroup000001_source : RVFileSource (1)
90+
{
91+
cut
92+
{
93+
int in = 0
94+
int out = 9
95+
}
96+
97+
group
98+
{
99+
float fps = 24
100+
}
101+
102+
media
103+
{
104+
string movie = [ "blank,start=1.0,end=192.0,fps=24.0.movieproc" "blank,start=1.0,end=192.0,fps=24.0.movieproc" "sample_data/one_clip.mov" ]
105+
}
106+
107+
otio
108+
{
109+
string metadata = "{\"pixar\":{\"OTIO_SCHEMA\":\"PixarMetadata.1\",\"cache\":{\"hitech\":{\"OTIO_SCHEMA\":\"PixarHitech.1\",\"shot\":null,\"take\":null}},\"take\":{\"OTIO_SCHEMA\":\"PixarTake.1\",\"globaltake\":1,\"prod\":\"ppjoshm\",\"shot\":\"ppjoshm_1\",\"unit\":\"none\"}}}"
110+
}
111+
}

contrib/opentimelineio_contrib/adapters/tests/sample_data/screening_example.rv

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ sourceGroup000000_source : RVFileSource (1)
6464
string movie = "smptebars,start=86501.0,end=86531.0,fps=24.0.movieproc"
6565
}
6666

67-
attributes
67+
otio
6868
{
69-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_501.LAY3.01']}}"
69+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_501.LAY3.01\"],\"reel\":\"ZZ100_50\"}}"
7070
}
7171
}
7272

@@ -96,9 +96,9 @@ sourceGroup000001_source : RVFileSource (1)
9696
string movie = "smptebars,start=86557.0,end=86606.0,fps=24.0.movieproc"
9797
}
9898

99-
attributes
99+
otio
100100
{
101-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_502A.LAY3.02']}}"
101+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_502A.LAY3.02\"],\"reel\":\"ZZ100_50\"}}"
102102
}
103103
}
104104

@@ -128,9 +128,9 @@ sourceGroup000002_source : RVFileSource (1)
128128
string movie = "smptebars,start=86601.0,end=86628.0,fps=24.0.movieproc"
129129
}
130130

131-
attributes
131+
otio
132132
{
133-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_503A.LAY1.01']}}"
133+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_503A.LAY1.01\"],\"reel\":\"ZZ100_50\"}}"
134134
}
135135
}
136136

@@ -160,9 +160,9 @@ sourceGroup000003_source : RVFileSource (1)
160160
string movie = "smptebars,start=86641.0,end=86755.0,fps=24.0.movieproc"
161161
}
162162

163-
attributes
163+
otio
164164
{
165-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_504C.LAY1.02']}}"
165+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_504C.LAY1.02\"],\"reel\":\"ZZ100_50\"}}"
166166
}
167167
}
168168

@@ -192,9 +192,9 @@ sourceGroup000004_source : RVFileSource (1)
192192
string movie = "smptebars,start=86753.0,end=86853.0,fps=24.0.movieproc"
193193
}
194194

195-
attributes
195+
otio
196196
{
197-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_504B.LAY1.02']}}"
197+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_504B.LAY1.02\"],\"reel\":\"ZZ100_50\"}}"
198198
}
199199
}
200200

@@ -224,9 +224,9 @@ sourceGroup000005_source : RVFileSource (1)
224224
string movie = "smptebars,start=86501.0,end=86661.0,fps=24.0.movieproc"
225225
}
226226

227-
attributes
227+
otio
228228
{
229-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_507C.LAY2.01']}}"
229+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_507C.LAY2.01\"],\"reel\":\"ZZ100_50\"}}"
230230
}
231231
}
232232

@@ -256,9 +256,9 @@ sourceGroup000006_source : RVFileSource (1)
256256
string movie = "smptebars,start=86628.0,end=86797.0,fps=24.0.movieproc"
257257
}
258258

259-
attributes
259+
otio
260260
{
261-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_50', 'comments': [u'SOURCE FILE: ZZ100_508.LAY2.02']}}"
261+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_508.LAY2.02\"],\"reel\":\"ZZ100_50\"}}"
262262
}
263263
}
264264

@@ -288,9 +288,9 @@ sourceGroup000007_source : RVFileSource (1)
288288
string movie = "smptebars,start=86722.0,end=86857.0,fps=24.0.movieproc"
289289
}
290290

291-
attributes
291+
otio
292292
{
293-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_51', 'comments': [u'SOURCE FILE: ZZ100_510.LAY1.02']}}"
293+
string metadata = "{\"cmx_3600\":{\"comments\":[\"SOURCE FILE: ZZ100_510.LAY1.02\"],\"reel\":\"ZZ100_51\"}}"
294294
}
295295
}
296296

@@ -320,8 +320,8 @@ sourceGroup000008_source : RVFileSource (1)
320320
string movie = "smptebars,start=86501.0,end=86757.0,fps=24.0.movieproc"
321321
}
322322

323-
attributes
323+
otio
324324
{
325-
string otio_metadata = "{'cmx_3600': {'reel': u'ZZ100_51', 'comments': [u'AVX2 EFFECT, RESIZE', u'SOURCE FILE: ZZ100_510B.LAY1.02']}}"
325+
string metadata = "{\"cmx_3600\":{\"comments\":[\"AVX2 EFFECT, RESIZE\",\"SOURCE FILE: ZZ100_510B.LAY1.02\"],\"reel\":\"ZZ100_51\"}}"
326326
}
327327
}

0 commit comments

Comments
 (0)