[Bf-blender-cvs] [e74ba9e09e7] master: Fix T79872: VSE - splitting strip shows the channel number when unused

Philipp Oeser noreply at git.blender.org
Sun Aug 23 13:21:29 CEST 2020


Commit: e74ba9e09e74a1a6d340877469eed05c810f46b3
Author: Philipp Oeser
Date:   Wed Aug 19 13:36:55 2020 +0200
Branches: master
https://developer.blender.org/rBe74ba9e09e74a1a6d340877469eed05c810f46b3

Fix T79872: VSE - splitting strip shows the channel number when unused

This operator is dependent on mouse position (if the Use Cursor Position
option is used). The Channel property is irrelevant/unused in this case.
So it is not optimal displaying this property when calling this from the
menu (or even using the shortcut with default settings).

Now use a custom UI in the Adjust Last Operation panel in this case.
The properties are now drawn in relation to another then (Channel
underneath Use Cursor Position) next to some other minor layout
improvements.

Thx @HooglyBoogly for feedback (also providing UI code)

Maniphest Tasks: T79872

Differential Revision: https://developer.blender.org/D8625

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

M	source/blender/editors/space_sequencer/sequencer_edit.c

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

diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index dcbac9bc817..3802dee248a 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -58,6 +58,7 @@
 #include "ED_sequencer.h"
 
 #include "UI_interface.h"
+#include "UI_resources.h"
 #include "UI_view2d.h"
 
 #include "DEG_depsgraph.h"
@@ -2383,6 +2384,28 @@ static int sequencer_split_invoke(bContext *C, wmOperator *op, const wmEvent *ev
   return sequencer_split_exec(C, op);
 }
 
+static void sequencer_split_ui(bContext *UNUSED(C), wmOperator *op)
+{
+  uiLayout *layout = op->layout;
+  uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
+
+  PointerRNA ptr;
+  RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
+
+  uiLayout *row = uiLayoutRow(layout, false);
+  uiItemR(row, &ptr, "type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+  uiItemR(layout, &ptr, "frame", 0, NULL, ICON_NONE);
+  uiItemR(layout, &ptr, "side", 0, NULL, ICON_NONE);
+
+  uiItemS(layout);
+
+  uiItemR(layout, &ptr, "use_cursor_position", 0, NULL, ICON_NONE);
+  if (RNA_boolean_get(&ptr, "use_cursor_position")) {
+    uiItemR(layout, &ptr, "channel", 0, NULL, ICON_NONE);
+  }
+}
+
 void SEQUENCER_OT_split(struct wmOperatorType *ot)
 {
   /* Identifiers. */
@@ -2394,6 +2417,7 @@ void SEQUENCER_OT_split(struct wmOperatorType *ot)
   ot->invoke = sequencer_split_invoke;
   ot->exec = sequencer_split_exec;
   ot->poll = sequencer_edit_poll;
+  ot->ui = sequencer_split_ui;
 
   /* Flags. */
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;



More information about the Bf-blender-cvs mailing list