@@ -450,7 +450,7 @@ def make_clip(self, comment_data):
450
450
}
451
451
}
452
452
453
- if 'locator ' in comment_data :
453
+ if 'locators ' in comment_data :
454
454
# An example EDL locator line looks like this:
455
455
# * LOC: 01:00:01:14 RED ANIM FIX NEEDED
456
456
# We get the part after "LOC: " as the comment_data entry
@@ -459,11 +459,15 @@ def make_clip(self, comment_data):
459
459
# variations of EDL, so if we are lenient then maybe we
460
460
# can handle more of them? Only real-world testing will
461
461
# determine this for sure...
462
- m = re .match (
463
- r'(\d\d:\d\d:\d\d:\d\d)\s+(\w*)(\s+|$)(.*)' ,
464
- comment_data ["locator" ]
465
- )
466
- if m :
462
+ for locator in comment_data ['locators' ]:
463
+ m = re .match (
464
+ r'(\d\d:\d\d:\d\d:\d\d)\s+(\w*)(\s+|$)(.*)' ,
465
+ locator
466
+ )
467
+ if not m :
468
+ # TODO: Should we report this as a warning somehow?
469
+ continue
470
+
467
471
marker = schema .Marker ()
468
472
marker .marked_range = opentime .TimeRange (
469
473
start_time = opentime .from_timecode (
@@ -477,7 +481,6 @@ def make_clip(self, comment_data):
477
481
# is not a valid enum somehow.
478
482
color_parsed_from_file = m .group (2 )
479
483
480
- marker .metadata .clear ()
481
484
marker .metadata .update ({
482
485
"cmx_3600" : {
483
486
"color" : color_parsed_from_file
@@ -495,9 +498,6 @@ def make_clip(self, comment_data):
495
498
496
499
marker .name = m .group (4 )
497
500
clip .markers .append (marker )
498
- else :
499
- # TODO: Should we report this as a warning somehow?
500
- pass
501
501
502
502
clip .source_range = opentime .range_from_start_end_time (
503
503
opentime .from_timecode (self .source_tc_in , self .edl_rate ),
@@ -580,7 +580,7 @@ class CommentHandler(object):
580
580
('FROM CLIP NAME' , 'clip_name' ),
581
581
('FROM CLIP' , 'media_reference' ),
582
582
('FROM FILE' , 'media_reference' ),
583
- ('LOC' , 'locator ' ),
583
+ ('LOC' , 'locators ' ),
584
584
('ASC_SOP' , 'asc_sop' ),
585
585
('ASC_SAT' , 'asc_sat' ),
586
586
('M2' , 'motion_effect' ),
@@ -598,9 +598,18 @@ def parse(self, comment):
598
598
regex = self .regex_template .format (id = comment_id )
599
599
match = re .match (regex , comment )
600
600
if match :
601
- self .handled [comment_type ] = match .group (
602
- 'comment_body'
603
- ).strip ()
601
+ comment_body = match .group ('comment_body' ).strip ()
602
+
603
+ # Special case for locators. There can be multiple locators per clip.
604
+ if comment_type == 'locators' :
605
+ try :
606
+ self .handled [comment_type ].append (comment_body )
607
+ except KeyError :
608
+ self .handled [comment_type ] = [comment_body ]
609
+
610
+ else :
611
+ self .handled [comment_type ] = comment_body
612
+
604
613
break
605
614
else :
606
615
stripped = comment .lstrip ('*' ).strip ()
0 commit comments