Request from Mango team which will most probably expected by everyone:
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 26 Mar 2012 13:48:45 +0000 (13:48 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 26 Mar 2012 13:48:45 +0000 (13:48 +0000)
Refresh Sequencer button will now update lengths of strips as well.

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

index ba75da1444b5e4608d60bd90b2f97f99e72ade32..50793f1358b505e86f823bfc13a0214e4f0c1c08 100644 (file)
@@ -242,7 +242,6 @@ class SEQUENCER_MT_strip(Menu):
         layout.operator("sequencer.offset_clear")
         layout.operator("sequencer.deinterlace_selected_movies")
         layout.operator("sequencer.rebuild_proxy")
-        layout.operator("sequencer.update_strip_length")
         layout.separator()
 
         layout.operator("sequencer.duplicate")
index bcc2c3585295e3a80490b0a46f73ec592d6e9d6f..935c17b1af0b975128824438b4f913aef48d1c29 100644 (file)
@@ -1306,12 +1306,45 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot)
 }
 
 /* reload operator */
+static void sequencer_refresh_all_length(Scene *scene, Editing *ed)
+{
+       Sequence *seq;
+
+       SEQP_BEGIN(ed, seq) {
+               int changed = FALSE;
+
+               switch (seq->type) {
+                       case SEQ_SCENE:
+                               seq->len = seq->scene->r.efra - seq->scene->r.sfra + 1;
+                               changed = TRUE;
+                               break;
+                       case SEQ_MOVIECLIP:
+                               seq->len = BKE_movieclip_get_duration(seq->clip);
+                               changed = TRUE;
+                               break;
+                       case SEQ_MOVIE:
+                               seq->len = IMB_anim_get_duration(seq->anim, IMB_TC_RECORD_RUN);
+                               changed = TRUE;
+                               break;
+               }
+
+               if (changed) {
+                       calc_sequence_disp(scene, seq);
+
+                       if (seq_test_overlap(ed->seqbasep, seq))
+                               shuffle_seq(ed->seqbasep, seq, scene);
+               }
+       }
+       SEQ_END
+}
+
 static int sequencer_refresh_all_exec(bContext *C, wmOperator *UNUSED(op))
 {
        Scene *scene= CTX_data_scene(C);
        Editing *ed= seq_give_editing(scene, FALSE);
 
        free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
+       sequencer_refresh_all_length(scene, ed);
 
        WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
 
@@ -3070,64 +3103,3 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot)
        WM_operator_properties_filesel(ot, FOLDERFILE|IMAGEFILE|MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY|WM_FILESEL_RELPATH|WM_FILESEL_FILEPATH|WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
 }
 
-static int sequencer_update_strip_length_exec(bContext *C, wmOperator *UNUSED(op))
-{
-       Scene *scene = CTX_data_scene(C);
-       Editing *ed = seq_give_editing(scene, FALSE);
-       Sequence *seq;
-       int update = FALSE;
-
-       SEQP_BEGIN(ed, seq) {
-               if ((seq->flag & SELECT)) {
-                       int changed = FALSE;
-
-                       switch (seq->type) {
-                               case SEQ_SCENE:
-                                       seq->len = seq->scene->r.efra - seq->scene->r.sfra + 1;
-                                       changed = TRUE;
-                                       break;
-                               case SEQ_MOVIECLIP:
-                                       seq->len = BKE_movieclip_get_duration(seq->clip);
-                                       changed = TRUE;
-                                       break;
-                               case SEQ_MOVIE:
-                                       seq->len = IMB_anim_get_duration(seq->anim, IMB_TC_RECORD_RUN);
-                                       changed = TRUE;
-                                       break;
-                       }
-
-                       if (changed) {
-                               calc_sequence_disp(scene, seq);
-
-                               if (seq_test_overlap(ed->seqbasep, seq))
-                                       shuffle_seq(ed->seqbasep, seq, scene);
-
-                               update = TRUE;
-                       }
-               }
-       }
-       SEQ_END
-
-       if (update) {
-               free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
-
-               WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);
-       }
-
-       return OPERATOR_FINISHED;
-}
-
-void SEQUENCER_OT_update_strip_length(wmOperatorType *ot)
-{
-       /* identifiers */
-       ot->name = "Update Strip Length";
-       ot->idname = "SEQUENCER_OT_update_strip_length";
-       ot->description = "Update actual content length for selected strips";
-
-       /* api callbacks */
-       ot->exec = sequencer_update_strip_length_exec;
-       ot->poll = ED_operator_sequencer_active;
-
-       /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
-}
index 2e24a8be3467ee7719a8779f73e55069a0aaef0e..c0f1bd219f283feb2d85ef1ca78f3fa3ff560d03 100644 (file)
@@ -113,8 +113,6 @@ void sequencer_operatortypes(void)
 
        WM_operatortype_append(SEQUENCER_OT_copy);
        WM_operatortype_append(SEQUENCER_OT_paste);
-
-       WM_operatortype_append(SEQUENCER_OT_update_strip_length);
 }