- recently restored sequencer change data operator didnt reset the offsets after...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 14 Aug 2011 03:59:22 +0000 (03:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 14 Aug 2011 03:59:22 +0000 (03:59 +0000)
- add change data operator to strip panel next to image file properties since editing every image manually isnt really usable.
- added new sequencer operator "Clear Offsets" (Alt+O), useful to reset the start/end frames around the strip data.

release/scripts/startup/bl_ui/space_sequencer.py
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_intern.h
source/blender/editors/space_sequencer/sequencer_ops.c

index 23dfdcfba90d9027a36a5950425fe32d386964e9..84cc365425ebe59d4e7aec3e819d5ac132dcc797 100644 (file)
@@ -239,6 +239,7 @@ class SEQUENCER_MT_strip(Menu):
         layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
         layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
         layout.operator("sequencer.images_separate")
         layout.operator("sequencer.cut", text="Cut (hard) at frame").type = 'HARD'
         layout.operator("sequencer.cut", text="Cut (soft) at frame").type = 'SOFT'
         layout.operator("sequencer.images_separate")
+        layout.operator("sequencer.offset_clear")
         layout.operator("sequencer.deinterlace_selected_movies")
         layout.separator()
 
         layout.operator("sequencer.deinterlace_selected_movies")
         layout.separator()
 
@@ -381,6 +382,8 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
 
         if elem and elem.orig_width > 0 and elem.orig_height > 0:
             col.label(text="Orig Dim: %dx%d" % (elem.orig_width, elem.orig_height))
 
         if elem and elem.orig_width > 0 and elem.orig_height > 0:
             col.label(text="Orig Dim: %dx%d" % (elem.orig_width, elem.orig_height))
+        else:
+            col.label(text="Orig Dim: None")
 
 
 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
 
 
 class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
@@ -565,6 +568,9 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
                 col = split.column()
                 col.prop(elem, "filename", text="")  # strip.elements[0] could be a fallback
 
                 col = split.column()
                 col.prop(elem, "filename", text="")  # strip.elements[0] could be a fallback
 
+            # also accessible from the menu
+            layout.operator("sequencer.change_path")
+
         elif seq_type == 'MOVIE':
             split = layout.split(percentage=0.2)
             col = split.column()
         elif seq_type == 'MOVIE':
             split = layout.split(percentage=0.2)
             col = split.column()
index a58bec9eeb989f7fda0ca80f50332b8a0a76a371..447426aed13f1e5665793de51ef86fe5ce5c3848 100644 (file)
@@ -1569,6 +1569,58 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
 }
 
 
 }
 
 
+/* offset clear operator */
+static int sequencer_offset_clear_exec(bContext *C, wmOperator *UNUSED(op))
+{
+       Scene *scene= CTX_data_scene(C);
+       Editing *ed= seq_give_editing(scene, FALSE);
+       Sequence *seq;
+
+       /* for effects, try to find a replacement input */
+       for(seq=ed->seqbasep->first; seq; seq=seq->next) {
+               if((seq->type & SEQ_EFFECT)==0 && (seq->flag & SELECT)) {
+                       seq->startofs= seq->endofs= seq->startstill= seq->endstill= 0;
+               }
+       }
+
+       /* updates lengths etc */
+       seq= ed->seqbasep->first;
+       while(seq) {
+               calc_sequence(scene, seq);
+               seq= seq->next;
+       }
+
+       for(seq=ed->seqbasep->first; seq; seq=seq->next) {
+               if((seq->type & SEQ_EFFECT)==0 && (seq->flag & SELECT)) {
+                       if(seq_test_overlap(ed->seqbasep, seq)) {
+                               shuffle_seq(ed->seqbasep, seq, scene);
+                       }
+               }
+       }
+
+       WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
+
+       return OPERATOR_FINISHED;
+}
+
+
+void SEQUENCER_OT_offset_clear(wmOperatorType *ot)
+{
+
+       /* identifiers */
+       ot->name= "Clear Strip Offset";
+       ot->idname= "SEQUENCER_OT_offset_clear";
+       ot->description="Clear strip offsets from the start and end frames";
+
+       /* api callbacks */
+       ot->exec= sequencer_offset_clear_exec;
+       ot->poll= sequencer_edit_poll;
+
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+
 /* separate_images operator */
 static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
 {
 /* separate_images operator */
 static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
 {
@@ -2803,6 +2855,9 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
                }
                RNA_END;
 
                }
                RNA_END;
 
+               /* reset these else we wont see all the images */
+               seq->anim_startofs= seq->anim_endofs= 0;
+
                /* correct start/end frames so we dont move
                 * important not to set seq->len= len; allow the function to handle it */
                reload_sequence_new_file(scene, seq, TRUE);
                /* correct start/end frames so we dont move
                 * important not to set seq->len= len; allow the function to handle it */
                reload_sequence_new_file(scene, seq, TRUE);
index 6eef2bb8361e078b714865a748738bf97f75aaee..7ab76f9b6d7e6043b2907009e52d6c1392dbfcdc 100644 (file)
@@ -93,6 +93,7 @@ void SEQUENCER_OT_reassign_inputs(struct wmOperatorType *ot);
 void SEQUENCER_OT_swap_inputs(struct wmOperatorType *ot);
 void SEQUENCER_OT_duplicate(struct wmOperatorType *ot);
 void SEQUENCER_OT_delete(struct wmOperatorType *ot);
 void SEQUENCER_OT_swap_inputs(struct wmOperatorType *ot);
 void SEQUENCER_OT_duplicate(struct wmOperatorType *ot);
 void SEQUENCER_OT_delete(struct wmOperatorType *ot);
+void SEQUENCER_OT_offset_clear(struct wmOperatorType *ot);
 void SEQUENCER_OT_images_separate(struct wmOperatorType *ot);
 void SEQUENCER_OT_meta_toggle(struct wmOperatorType *ot);
 void SEQUENCER_OT_meta_make(struct wmOperatorType *ot);
 void SEQUENCER_OT_images_separate(struct wmOperatorType *ot);
 void SEQUENCER_OT_meta_toggle(struct wmOperatorType *ot);
 void SEQUENCER_OT_meta_make(struct wmOperatorType *ot);
index ebf400ad5ffe2487b4cedb3a320d28dd513750da..df33ce73b9c3879f0792768834a78eb9c4eb534f 100644 (file)
@@ -68,6 +68,7 @@ void sequencer_operatortypes(void)
        WM_operatortype_append(SEQUENCER_OT_swap_inputs);
        WM_operatortype_append(SEQUENCER_OT_duplicate);
        WM_operatortype_append(SEQUENCER_OT_delete);
        WM_operatortype_append(SEQUENCER_OT_swap_inputs);
        WM_operatortype_append(SEQUENCER_OT_duplicate);
        WM_operatortype_append(SEQUENCER_OT_delete);
+       WM_operatortype_append(SEQUENCER_OT_offset_clear);
        WM_operatortype_append(SEQUENCER_OT_images_separate);
        WM_operatortype_append(SEQUENCER_OT_meta_toggle);
        WM_operatortype_append(SEQUENCER_OT_meta_make);
        WM_operatortype_append(SEQUENCER_OT_images_separate);
        WM_operatortype_append(SEQUENCER_OT_meta_toggle);
        WM_operatortype_append(SEQUENCER_OT_meta_make);
@@ -149,6 +150,8 @@ void sequencer_keymap(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "SEQUENCER_OT_reassign_inputs", RKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "SEQUENCER_OT_reload", RKEY, KM_PRESS, KM_ALT, 0);
 
        WM_keymap_add_item(keymap, "SEQUENCER_OT_reassign_inputs", RKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "SEQUENCER_OT_reload", RKEY, KM_PRESS, KM_ALT, 0);
 
+       WM_keymap_add_item(keymap, "SEQUENCER_OT_offset_clear", OKEY, KM_PRESS, KM_ALT, 0);
+
        WM_keymap_add_item(keymap, "SEQUENCER_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
 
        WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", XKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "SEQUENCER_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
 
        WM_keymap_add_item(keymap, "SEQUENCER_OT_delete", XKEY, KM_PRESS, 0, 0);