|
49 | 49 | AAF_OPERATIONDEF_SUBMASTER = uuid.UUID("f1db0f3d-8d64-11d3-80df-006008143e6f")
|
50 | 50 |
|
51 | 51 |
|
| 52 | +def _is_considered_gap(thing): |
| 53 | + """Returns whether or not thiing can be considered gap. |
| 54 | +
|
| 55 | + TODO: turns generators w/ kind "Slug" inito gap. Should probably generate |
| 56 | + opaque black instead. |
| 57 | + """ |
| 58 | + if isinstance(thing, otio.schema.Gap): |
| 59 | + return True |
| 60 | + |
| 61 | + if ( |
| 62 | + isinstance(thing, otio.schema.Clip) |
| 63 | + and isinstance( |
| 64 | + thing.media_reference, |
| 65 | + otio.schema.GeneratorReference) |
| 66 | + ): |
| 67 | + if thing.media_reference.generator_kind in ("Slug",): |
| 68 | + return True |
| 69 | + else: |
| 70 | + raise otio.exceptions.NotSupportedError( |
| 71 | + "AAF adapter does not support generator references of kind" |
| 72 | + " '{}'".format(thing.media_reference.generator_kind) |
| 73 | + ) |
| 74 | + |
| 75 | + return False |
| 76 | + |
| 77 | + |
52 | 78 | class AAFAdapterError(otio.exceptions.OTIOError):
|
53 | 79 | pass
|
54 | 80 |
|
@@ -144,7 +170,7 @@ def validate_metadata(timeline):
|
144 | 170 |
|
145 | 171 | for child in timeline.each_child():
|
146 | 172 | checks = []
|
147 |
| - if isinstance(child, otio.schema.Gap): |
| 173 | + if _is_considered_gap(child): |
148 | 174 | checks = [
|
149 | 175 | __check(child, "duration().rate").equals(edit_rate)
|
150 | 176 | ]
|
@@ -223,6 +249,8 @@ def _generate_empty_mobid(clip):
|
223 | 249 | clip_mob_ids = {}
|
224 | 250 |
|
225 | 251 | for otio_clip in input_otio.each_clip():
|
| 252 | + if _is_considered_gap(otio_clip): |
| 253 | + continue |
226 | 254 | for strategy in strategies:
|
227 | 255 | mob_id = strategy(otio_clip)
|
228 | 256 | if mob_id:
|
@@ -281,7 +309,7 @@ def __init__(self, root_file_transcriber, otio_track):
|
281 | 309 |
|
282 | 310 | def transcribe(self, otio_child):
|
283 | 311 | """Transcribe otio child to corresponding AAF object"""
|
284 |
| - if isinstance(otio_child, otio.schema.Gap): |
| 312 | + if _is_considered_gap(otio_child): |
285 | 313 | filler = self.aaf_filler(otio_child)
|
286 | 314 | return filler
|
287 | 315 | elif isinstance(otio_child, otio.schema.Transition):
|
|
0 commit comments