@@ -369,10 +369,8 @@ def clear_markers():
369369
370370# Commands
371371def add_change ():
372-
373372
374373 global refresh_now
375-
376374 create_marker ()
377375
378376 print ("Fresh" )
@@ -387,38 +385,8 @@ def clear_changes():
387385 return
388386
389387 refresh_now = True
390-
391- def commit_changes ():
392-
393- timeline = resolve .active_timeline
394- framerate = timeline .settings .frame_rate
395- min_duration = int (framerate ) * 2
396- markers = timeline .markers .find_all ("patchwork_marker" )
397-
398- patchfile = PatchFile (track_patch_file .chosen_filepath )
399- saved_settings = patchfile .load ()
400- print (saved_settings )
401- # compare_settings = patchfile.compare()
402-
403- assert markers
404-
405- invalid_markers = [x for x in markers if x .duration < min_duration ]
406- if invalid_markers :
407- dialog_box .prompt (
408- "Markers shouldn't be shorter than 2 seconds.\n "
409- f"These markers are invalid:\n { invalid_markers } " ,
410- )
411- return
412-
413- # TODO: Check for overlapping markers
414-
415- for x in markers :
416- x .color = "Green"
417-
418- patchfile .update (markers )
419-
420-
421- def push_changes ():
388+
389+ def render_changes ():
422390
423391 project = resolve .project
424392 timeline = resolve .active_timeline
@@ -547,42 +515,27 @@ def setup_gui():
547515 dpg .add_text ("Mark changes on the active timeline to patch the master file with" , wrap = 500 )
548516 dpg .add_spacer (height = 20 )
549517
550-
551518 with dpg .group (tag = "add_group" , horizontal = True ):
552519
553520 # ADD BUTTON
554521 dpg .add_button (label = "Add" , tag = "add_button" , callback = add_change )
555522
556523 # CLEAR BUTTON
557- dpg .add_button (label = "hanges" , tag = "clear_changes_button" , callback = clear_changes )
558- with dpg .tooltip ("clear_changes_button" ):
559- dpg .add_text ("Clear all of Patchwork's ranged-markers\n from the active timeline" )
524+ dpg .add_button (label = "Clear All" , tag = "clear_changes_button" , callback = clear_changes )
560525
561526 dpg .add_text ("N/A" , tag = "current_timecode_display" , color = [255 , 150 , 0 ])
562527
563- dpg .add_separator ()
564- dpg .add_spacer (height = 20 )
565-
566- # COMMIT BUTTON
567- dpg .add_text ("Commit changes and create render jobs" , wrap = 500 )
568- with dpg .group (tag = "commit_group" ):
569- dpg .add_text ("No changes to commit" , tag = "commit_status" , color = [255 , 100 , 100 ], wrap = 500 )
570- dpg .add_button (label = "Commit" , tag = "commit_button" , callback = commit_changes )
571-
572528 dpg .add_separator ()
573529 dpg .add_spacer (height = 20 )
574530
575- # PUSH BUTTON
576- dpg .add_button (label = "Push " , tag = "push_button " , callback = push_changes )
577- with dpg .tooltip ("push_button " ):
531+ # RENDER BUTTON
532+ dpg .add_button (label = "Render " , tag = "render_button " , callback = render_changes )
533+ with dpg .tooltip ("render_button " ):
578534 dpg .add_text ("Render and merge changes" )
579535
580536 dpg .add_separator ()
581537 dpg .add_spacer (height = 20 )
582538
583-
584- dpg .add_spacer (height = 20 )
585-
586539 # SOURCE PAGE
587540 with dpg .tab (label = "Source" ):
588541
@@ -674,24 +627,7 @@ async def render():
674627 logger .debug ("[magenta]Running complex routines" )
675628 await routines .check_timecode_starts_at_zero (current_frame_rate , current_timecode )
676629 await routines .refresh_add_status (current_markers , current_timecode , current_frame )
677- await routines .refresh_commit_status (current_markers )
678-
679- # TODO: Check Resolve is open, lock up whole interface with warning otherwise
680- # No option to dismiss dialog box. Automatically dismiss box when Resolve is opened
681630
682- # TODO: Check timeline is open, lock up whole interface with warning otherwise
683- # No option to dismiss dialog box. Automatically dismiss box when timeline is opened
684-
685- # TODO: Check timeline is same as tracked timeline, disable changes page
686- # On each timeline change, ensure custom settings are enabled. Make it so.
687-
688- # RUN EVERY HALF SECOND REGARDLESS OF ENVIRONMENT STATE
689- current_timecode = copy .copy (resolve .active_timeline .timecode )
690-
691- logger .debug ("[magenta]Running complex routines" )
692- await routines .refresh_add_status (markers , current_timecode , current_frame )
693- await routines .refresh_commit_status (markers )
694-
695631 await trio .sleep (0 )
696632
697633async def main ():
0 commit comments