Revert "Change Enables proxy operator to Copy proxy operator."
authorAntony Riakiotakis <kalast@gmail.com>
Thu, 26 Mar 2015 14:44:51 +0000 (15:44 +0100)
committerAntony Riakiotakis <kalast@gmail.com>
Thu, 26 Mar 2015 14:44:51 +0000 (15:44 +0100)
This reverts commit ec03ab021f171bf529746bb440756fbc986b45e7.

Changing this since it looks like Mattieu does not really like the change.
Will be adding another way to tweak the directories

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 feaef352978c95a754bce9a998039cae1bae6107..4f83cc03b1091e7a20dd9ddf259c696ee3e3321b 100644 (file)
@@ -926,14 +926,24 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
                 flow.prop(proxy, "directory")
             if proxy.use_proxy_custom_file:
                 flow.prop(proxy, "filepath")
-          
+
             layout.label("Enabled Proxies:")
-            col = layout.column()
-            col.prop(proxy, "build_25")
-            col.prop(proxy, "build_50")
-            col.prop(proxy, "build_75")
-            col.prop(proxy, "build_100")
-            col.prop(proxy, "use_overwrite")
+            enabled = ""
+            row = layout.row()
+            if (proxy.build_25):
+                enabled += "25% "
+            if (proxy.build_50):
+                enabled += "50% "
+            if (proxy.build_75):
+                enabled += "75% "
+            if (proxy.build_100):
+                enabled += "100% "
+
+            row.label(enabled)
+            if (proxy.use_overwrite):
+                layout.label("Overwrite On")
+            else:
+                layout.label("Overwrite Off")
 
             col = layout.column()
             col.label(text="Build JPEG quality")
@@ -946,7 +956,7 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
                 col.prop(proxy, "timecode")
 
         col = layout.column()
-        col.operator("sequencer.copy_proxy_settings")
+        col.operator("sequencer.enable_proxies")
         col.operator("sequencer.rebuild_proxy")
 
 
index b45d4277f353ec04190b6a532dbd302f9e96953a..ad38cb66946883659ea41dfd8e1cffc21fa0018a 100644 (file)
@@ -3473,31 +3473,24 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER;
 }
 
-static int sequencer_copy_proxy_settings_exec(bContext *C, wmOperator *UNUSED(op))
+static int sequencer_enable_proxies_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
+{
+       return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y);
+}
+
+static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
        Editing *ed = BKE_sequencer_editing_get(scene, false);
-       Sequence *actseq = ed->act_seq;
        Sequence *seq;
-       StripProxy *actproxy, *proxy;
-       bool proxy_25;
-       bool proxy_50;
-       bool proxy_75;
-       bool proxy_100;
+       bool proxy_25 = RNA_boolean_get(op->ptr, "proxy_25");
+       bool proxy_50 = RNA_boolean_get(op->ptr, "proxy_50");
+       bool proxy_75 = RNA_boolean_get(op->ptr, "proxy_75");
+       bool proxy_100 = RNA_boolean_get(op->ptr, "proxy_100");
+       bool override = RNA_boolean_get(op->ptr, "override");
        bool turnon = true;
 
-       if (ed == NULL || actseq == NULL || !actseq->strip || !actseq->strip->proxy) {
-               return OPERATOR_CANCELLED;
-       }
-
-       actproxy = actseq->strip->proxy;
-
-       proxy_25 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_25) != 0;
-       proxy_50 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_50) != 0;
-       proxy_75 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_75) != 0;
-       proxy_100 = (actproxy->build_size_flags & SEQ_PROXY_IMAGE_SIZE_100) != 0;
-
-       if (!(proxy_25 || proxy_50 || proxy_75 || proxy_100)) {
+       if (ed == NULL || !(proxy_25 || proxy_50 || proxy_75 || proxy_100)) {
                turnon = false;
        }
 
@@ -3510,8 +3503,30 @@ static int sequencer_copy_proxy_settings_exec(bContext *C, wmOperator *UNUSED(op
                                        continue;
                                }
 
-                               proxy = seq->strip->proxy;
-                               *proxy = *actproxy;
+                               if (proxy_25)
+                                       seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_25;
+                               else 
+                                       seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_25;
+                               
+                               if (proxy_50)
+                                       seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_50;
+                               else 
+                                       seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_50;
+                               
+                               if (proxy_75)
+                                       seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_75;
+                               else 
+                                       seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_75;
+                               
+                               if (proxy_100)
+                                       seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_100;
+                               else 
+                                       seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_100;
+                               
+                               if (!override)
+                                       seq->strip->proxy->build_flags |= SEQ_PROXY_SKIP_EXISTING;
+                               else 
+                                       seq->strip->proxy->build_flags &= ~SEQ_PROXY_SKIP_EXISTING;
                        }
                }
        }
@@ -3522,18 +3537,25 @@ static int sequencer_copy_proxy_settings_exec(bContext *C, wmOperator *UNUSED(op
        return OPERATOR_FINISHED;
 }
 
-void SEQUENCER_OT_copy_proxy_settings(wmOperatorType *ot)
+void SEQUENCER_OT_enable_proxies(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Copy Proxy Settings";
-       ot->idname = "SEQUENCER_OT_copy_proxy_settings";
-       ot->description = "Copy proxy settings of active strip selected strips";
+       ot->name = "Set Selected Strip Proxies";
+       ot->idname = "SEQUENCER_OT_enable_proxies";
+       ot->description = "Enable selected proxies on all selected Movie strips";
        
        /* api callbacks */
-       ot->exec = sequencer_copy_proxy_settings_exec;
+       ot->invoke = sequencer_enable_proxies_invoke;
+       ot->exec = sequencer_enable_proxies_exec;
        
        /* flags */
        ot->flag = OPTYPE_REGISTER;
+       
+       RNA_def_boolean(ot->srna, "proxy_25", false, "25%", "");
+       RNA_def_boolean(ot->srna, "proxy_50", false, "50%", "");
+       RNA_def_boolean(ot->srna, "proxy_75", false, "75%", "");
+       RNA_def_boolean(ot->srna, "proxy_100", false, "100%", "");
+       RNA_def_boolean(ot->srna, "override", false, "Override", "");
 }
 
 /* change ops */
index 8db0df5103530f5ea1b031b5708a5e5cbcec7ad9..461c72961c2fad84f23db9c99261bb636f367f65 100644 (file)
@@ -131,7 +131,7 @@ void SEQUENCER_OT_copy(struct wmOperatorType *ot);
 void SEQUENCER_OT_paste(struct wmOperatorType *ot);
 
 void SEQUENCER_OT_rebuild_proxy(struct wmOperatorType *ot);
-void SEQUENCER_OT_copy_proxy_settings(struct wmOperatorType *ot);
+void SEQUENCER_OT_enable_proxies(struct wmOperatorType *ot);
 
 /* preview specific operators */
 void SEQUENCER_OT_view_all_preview(struct wmOperatorType *ot);
index 29fd2deeb55e4c512313b52c6bec06a4420dafb4..33a8a1c5b41cbf3a54b645480639412cab9a0232 100644 (file)
@@ -88,7 +88,7 @@ void sequencer_operatortypes(void)
        WM_operatortype_append(SEQUENCER_OT_view_ghost_border);
 
        WM_operatortype_append(SEQUENCER_OT_rebuild_proxy);
-       WM_operatortype_append(SEQUENCER_OT_copy_proxy_settings);
+       WM_operatortype_append(SEQUENCER_OT_enable_proxies);
        WM_operatortype_append(SEQUENCER_OT_change_effect_input);
        WM_operatortype_append(SEQUENCER_OT_change_effect_type);
        WM_operatortype_append(SEQUENCER_OT_change_path);