def _set_sync_parent_clip(event, frame): child_clip, child_index, child_clip_track = parent_selection_data parent_track = tlinewidgets.get_track(event.y) if parent_track != current_sequence().tracks[current_sequence().first_video_index]: dialogutils.warning_message( _("Sync parent clips must be on track V1"), _("Selected sync parent clip is on track ") + utils.get_track_name(parent_track, current_sequence()) + _(".\nYou can only sync to clips that are on track V1."), gui.editor_window.window, True, ) return # this can't have parent clip already if child_clip.sync_data != None: return if parent_track == None: return parent_clip_index = current_sequence().get_clip_index(parent_track, frame) if parent_clip_index == -1: return # Parent and child can't be on the same track. # Now that all parent clips must be on track V1 this is no longer shoild be possible. if parent_track == child_clip_track: print "parent_track == child_clip_track" return parent_clip = parent_track.clips[parent_clip_index] # These cannot be chained. # Now that all parent clips must be on track V1 this is no longer shoild be possible. if parent_clip.sync_data != None: print "parent_clip.sync_data != None" return data = { "child_index": child_index, "child_track": child_clip_track, "parent_index": parent_clip_index, "parent_track": parent_track, } action = edit.set_sync_action(data) action.do_edit()
def _set_sync_parent_clip(event, frame): child_clip, child_index, child_clip_track = parent_selection_data parent_track = tlinewidgets.get_track(event.y) if parent_track != current_sequence().tracks[ current_sequence().first_video_index]: dialogutils.warning_message( _("Sync parent clips must be on track V1"), _("Selected sync parent clip is on track ") + utils.get_track_name(parent_track, current_sequence()) + _(".\nYou can only sync to clips that are on track V1."), gui.editor_window.window, True) return # this can't have parent clip already if child_clip.sync_data != None: return if parent_track == None: return parent_clip_index = current_sequence().get_clip_index(parent_track, frame) if parent_clip_index == -1: return # Parent and child can't be on the same track. # Now that all parent clips must be on track V1 this is no longer shoild be possible. if parent_track == child_clip_track: print "parent_track == child_clip_track" return parent_clip = parent_track.clips[parent_clip_index] # These cannot be chained. # Now that all parent clips must be on track V1 this is no longer shoild be possible. if parent_clip.sync_data != None: print "parent_clip.sync_data != None" return data = { "child_index": child_index, "child_track": child_clip_track, "parent_index": parent_clip_index, "parent_track": parent_track } action = edit.set_sync_action(data) action.do_edit()
def split_audio_synched(popup_data): """ We do two separate edits to do this, so if user undoes this he'll need to two undos, which may not be to user expectation as doing this is only one edit """ (parent_clip, child_clip, child_clip_track) = _do_split_audio_edit(popup_data) # This is quarenteed because GUI option to do this is only available on this track parent_track = current_sequence().tracks[current_sequence().first_video_index] child_index = child_clip_track.clips.index(child_clip) parent_clip_index = parent_track.clips.index(parent_clip) data = {"child_index":child_index, "child_track":child_clip_track, "parent_index":parent_clip_index, "parent_track":parent_track} action = edit.set_sync_action(data) action.do_edit()