Пример #1
0
def do_timeline_objects_copy():
    if _timeline_has_focus() == False:
        # try to extract text to clipboard because user pressed CTRL + C
        copy_source = gui.editor_window.window.get_focus()
        try:
            copy_source.copy_clipboard()
        except:  # selected widget was not a Gtk.Editable that can provide text to clipboard
            pass

        return

    if compositormodes.compositor != None and compositormodes.compositor.selected == True:
        editorstate.set_copy_paste_objects(
            (COPY_PASTA_DATA_COMPOSITOR_PROPERTIES,
             compositormodes.compositor.get_copy_paste_objects()))
        return

    if movemodes.selected_track != -1:
        # copying clips
        track = current_sequence().tracks[movemodes.selected_track]
        clone_clips = []
        for i in range(movemodes.selected_range_in,
                       movemodes.selected_range_out + 1):
            clone_clip = current_sequence().clone_track_clip(track, i)
            clone_clips.append(clone_clip)
        editorstate.set_copy_paste_objects(
            (COPY_PASTA_DATA_CLIPS, clone_clips))
        return
Пример #2
0
def do_timeline_objects_paste():
    if _timeline_has_focus() == False:
        return

    track = current_sequence().get_first_active_track()
    if track == None:
        return
    paste_objs = editorstate.get_copy_paste_objects()
    if paste_objs == None:
        return

    data_type, paste_clips = paste_objs
    if data_type != COPY_PASTA_DATA_CLIPS:
        do_compositor_data_paste(paste_objs)
        return

    tline_pos = editorstate.current_tline_frame()

    new_clips = []
    for clip in paste_clips:
        new_clip = current_sequence().create_clone_clip(clip)
        new_clips.append(new_clip)
    editorstate.set_copy_paste_objects((COPY_PASTA_DATA_CLIPS, new_clips))

    # Paste clips
    editevent.do_multiple_clip_insert(track, paste_clips, tline_pos)
Пример #3
0
def copy_action():
    if _timeline_has_focus() == False:
        filter_kf_editor = _get_focus_keyframe_editor(
            clipeffectseditor.keyframe_editor_widgets)
        geom_kf_editor = _get_focus_keyframe_editor(
            compositeeditor.keyframe_editor_widgets)
        if filter_kf_editor != None:
            value = filter_kf_editor.get_copy_kf_value()
            save_data = (appconsts.COPY_PASTE_KEYFRAME_EDITOR_KF_DATA,
                         (value, filter_kf_editor))
            editorstate.set_copy_paste_objects(save_data)
        elif geom_kf_editor != None:
            value = geom_kf_editor.get_copy_kf_value()
            save_data = (appconsts.COPY_PASTE_GEOMETRY_EDITOR_KF_DATA,
                         (value, geom_kf_editor))
            editorstate.set_copy_paste_objects(save_data)
        else:
            # Try to extract text to clipboard because user pressed CTRL + C
            copy_source = gui.editor_window.window.get_focus()
            try:
                copy_source.copy_clipboard()
            except:  # selected widget was not a Gtk.Editable that can provide text to clipboard
                pass
    else:
        tlineaction.do_timeline_objects_copy()
Пример #4
0
def do_timeline_objects_copy():
    if movemodes.selected_track != -1:
        # copying clips
        track = current_sequence().tracks[movemodes.selected_track]
        clone_clips = []
        for i in range(movemodes.selected_range_in, movemodes.selected_range_out + 1):
            clone_clip = current_sequence().clone_track_clip(track, i)
            clone_clips.append(clone_clip)
        editorstate.set_copy_paste_objects(clone_clips)
Пример #5
0
def do_timeline_objects_copy():
    if movemodes.selected_track != -1:
        # copying clips
        track = current_sequence().tracks[movemodes.selected_track]
        clone_clips = []
        for i in range(movemodes.selected_range_in, movemodes.selected_range_out + 1):
            clone_clip = current_sequence().clone_track_clip(track, i)
            clone_clips.append(clone_clip)
        editorstate.set_copy_paste_objects(clone_clips)
Пример #6
0
def do_timeline_objects_paste():
    track = current_sequence().get_first_active_track()
    if track == None:
        return

    paste_objs = editorstate.get_copy_paste_objects()
    if paste_objs == None:
        return

    tline_pos = editorstate.current_tline_frame()

    new_clips = []
    for clip in paste_objs:
        new_clip = current_sequence().create_clone_clip(clip)
        new_clips.append(new_clip)
    editorstate.set_copy_paste_objects(new_clips)

    # Paste clips
    editevent.do_multiple_clip_insert(track, paste_objs, tline_pos)
Пример #7
0
def do_timeline_objects_paste():
    track = current_sequence().get_first_active_track()
    if track == None:
        return

    paste_objs = editorstate.get_copy_paste_objects()
    if paste_objs == None:
        return

    tline_pos = editorstate.current_tline_frame()

    new_clips = []
    for clip in paste_objs:
        new_clip = current_sequence().create_clone_clip(clip)
        new_clips.append(new_clip)
    editorstate.set_copy_paste_objects(new_clips)

    # Paste clips
    editevent.do_multiple_clip_insert(track, paste_objs, tline_pos)
Пример #8
0
def do_timeline_objects_copy():
    if _timeline_has_focus() == False:
        # try to extract text to clipboard because user pressed CTRL + C
        copy_source = gui.editor_window.window.get_focus()
        try:
            copy_source.copy_clipboard()
        except:# selected widget was not a Gtk.Editable that can provide text to clipboard
            pass

        return 

    if movemodes.selected_track != -1:
        # copying clips
        track = current_sequence().tracks[movemodes.selected_track]
        clone_clips = []
        for i in range(movemodes.selected_range_in, movemodes.selected_range_out + 1):
            clone_clip = current_sequence().clone_track_clip(track, i)
            clone_clips.append(clone_clip)
        editorstate.set_copy_paste_objects(clone_clips)
        return