[Bf-blender-cvs] [d084967] master: Revert "Change Enables proxy operator to Copy proxy operator."

Antony Riakiotakis noreply at git.blender.org
Thu Mar 26 15:45:53 CET 2015


Commit: d084967627c5d568c87c616cead4f468d9a21887
Author: Antony Riakiotakis
Date:   Thu Mar 26 15:44:51 2015 +0100
Branches: master
https://developer.blender.org/rBd084967627c5d568c87c616cead4f468d9a21887

Revert "Change Enables proxy operator to Copy proxy operator."

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

===================================================================

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

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index feaef35..4f83cc0 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -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")
 
 
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index b45d427..ad38cb6 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -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 */
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 8db0df5..461c729 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -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);
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index 29fd2de..33a8a1c 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -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);




More information about the Bf-blender-cvs mailing list