Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFalk David <filedescriptor>2021-09-29 15:29:32 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-09-29 15:34:01 +0300
commit5cebcb415e76aaff74bc03c66414aa93b5c90e70 (patch)
tree3f5ab94862ce9a0f5e89e974ae4851135ae495b7 /source/blender/makesrna/intern/rna_sequencer.c
parentffb9577ac9a4c79483941389a052284b64930c8e (diff)
VSE: Add color tags to strips
This patch adds color tags to VSE strips, an overlay option to toggle the colors on and off, a section in the theme settings to define the 9 possible colors and two ways of changing the color tag through the UI. You can change the color through the right-click context menu, or in the strip side panel next to the strip name. Color tags are defined in user preferences and they can be disabled in overlay settings. Reviewed By: campbellbarton, ISS Differential Revision: https://developer.blender.org/D12405
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer.c')
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 6a03ee03f71..7303f6c920a 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -81,6 +81,20 @@ const EnumPropertyItem rna_enum_sequence_modifier_type_items[] = {
{0, NULL, 0, NULL, NULL},
};
+const EnumPropertyItem rna_enum_strip_color_items[] = {
+ {SEQUENCE_COLOR_NONE, "NONE", ICON_X, "None", "Assign no color tag to the collection"},
+ {SEQUENCE_COLOR_01, "COLOR_01", ICON_SEQUENCE_COLOR_01, "Color 01", ""},
+ {SEQUENCE_COLOR_02, "COLOR_02", ICON_SEQUENCE_COLOR_02, "Color 02", ""},
+ {SEQUENCE_COLOR_03, "COLOR_03", ICON_SEQUENCE_COLOR_03, "Color 03", ""},
+ {SEQUENCE_COLOR_04, "COLOR_04", ICON_SEQUENCE_COLOR_04, "Color 04", ""},
+ {SEQUENCE_COLOR_05, "COLOR_05", ICON_SEQUENCE_COLOR_05, "Color 05", ""},
+ {SEQUENCE_COLOR_06, "COLOR_06", ICON_SEQUENCE_COLOR_06, "Color 06", ""},
+ {SEQUENCE_COLOR_07, "COLOR_07", ICON_SEQUENCE_COLOR_07, "Color 07", ""},
+ {SEQUENCE_COLOR_08, "COLOR_08", ICON_SEQUENCE_COLOR_08, "Color 08", ""},
+ {SEQUENCE_COLOR_09, "COLOR_09", ICON_SEQUENCE_COLOR_09, "Color 09", ""},
+ {0, NULL, 0, NULL, NULL},
+};
+
#ifdef RNA_RUNTIME
# include "BKE_global.h"
@@ -1000,6 +1014,18 @@ static void rna_Sequence_opacity_set(PointerRNA *ptr, float value)
seq->blend_opacity = value * 100.0f;
}
+static int rna_Sequence_color_tag_get(PointerRNA *ptr)
+{
+ Sequence *seq = (Sequence *)(ptr->data);
+ return seq->color_tag;
+}
+
+static void rna_Sequence_color_tag_set(PointerRNA *ptr, int value)
+{
+ Sequence *seq = (Sequence *)(ptr->data);
+ seq->color_tag = value;
+}
+
static bool colbalance_seq_cmp_fn(Sequence *seq, void *arg_pt)
{
SequenceSearchData *data = arg_pt;
@@ -1938,6 +1964,14 @@ static void rna_def_sequence(BlenderRNA *brna)
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
+ prop = RNA_def_property(srna, "color_tag", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "color_tag");
+ RNA_def_property_enum_funcs(
+ prop, "rna_Sequence_color_tag_get", "rna_Sequence_color_tag_set", NULL);
+ RNA_def_property_enum_items(prop, rna_enum_strip_color_items);
+ RNA_def_property_ui_text(prop, "Strip Color", "Color tag for a strip");
+ RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
+
/* modifiers */
prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "SequenceModifier");