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 /release/scripts/startup/bl_ui/space_sequencer.py
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 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py58
1 files changed, 57 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 3622154a178..7b102604587 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -241,6 +241,7 @@ class SEQUENCER_PT_sequencer_overlay(Panel):
layout.prop(overlay_settings, "show_strip_name", text="Name")
layout.prop(overlay_settings, "show_strip_source", text="Source")
layout.prop(overlay_settings, "show_strip_duration", text="Duration")
+ layout.prop(overlay_settings, "show_strip_tag_color", text="Color Tags")
layout.separator()
@@ -869,6 +870,9 @@ class SEQUENCER_MT_strip(Menu):
layout.operator("sequencer.meta_toggle", text="Toggle Meta")
layout.separator()
+ layout.menu("SEQUENCER_MT_color_tag_picker")
+
+ layout.separator()
layout.menu("SEQUENCER_MT_strip_lock_mute")
layout.separator()
@@ -965,6 +969,9 @@ class SEQUENCER_MT_context_menu(Menu):
layout.operator("sequencer.meta_toggle", text="Toggle Meta")
layout.separator()
+ layout.menu("SEQUENCER_MT_color_tag_picker")
+
+ layout.separator()
layout.menu("SEQUENCER_MT_strip_lock_mute")
@@ -996,6 +1003,41 @@ class SequencerButtonsPanel_Output:
return cls.has_preview(context)
+class SEQUENCER_PT_color_tag_picker(Panel):
+ bl_label = "Color Tag"
+ bl_space_type = 'SEQUENCE_EDITOR'
+ bl_region_type = 'UI'
+ bl_category = "Strip"
+ bl_options = {'HIDE_HEADER', 'INSTANCED'}
+
+ @classmethod
+ def poll(cls, context):
+ return context.active_sequence_strip is not None
+
+ def draw(self, context):
+ layout = self.layout
+
+ row = layout.row(align=True)
+ row.operator("sequencer.strip_color_tag_set", icon="X").color = 'NONE'
+ for i in range(1, 10):
+ icon = 'SEQUENCE_COLOR_%02d' % i
+ row.operator("sequencer.strip_color_tag_set", icon=icon).color = 'COLOR_%02d' % i
+
+
+class SEQUENCER_MT_color_tag_picker(Menu):
+ bl_label = "Set Color Tag"
+
+ @classmethod
+ def poll(cls, context):
+ return context.active_sequence_strip is not None
+
+ def draw(self, context):
+ layout = self.layout
+
+ row = layout.row(align=True)
+ row.operator_enum("sequencer.strip_color_tag_set", "color", icon_only=True)
+
+
class SEQUENCER_PT_strip(SequencerButtonsPanel, Panel):
bl_label = ""
bl_options = {'HIDE_HEADER'}
@@ -1039,9 +1081,20 @@ class SEQUENCER_PT_strip(SequencerButtonsPanel, Panel):
else:
icon_header = 'SEQ_SEQUENCER'
- row = layout.row()
+ row = layout.row(align=True)
+ row.use_property_decorate = False
row.label(text="", icon=icon_header)
+ row.separator()
row.prop(strip, "name", text="")
+
+ sub = row.row(align=True)
+ if strip.color_tag == 'NONE':
+ sub.popover(panel="SEQUENCER_PT_color_tag_picker", text="", icon='COLOR')
+ else:
+ icon = 'SEQUENCE_' + strip.color_tag
+ sub.popover(panel="SEQUENCER_PT_color_tag_picker", text="", icon=icon)
+
+ row.separator()
row.prop(strip, "mute", toggle=True, icon_only=True, emboss=False)
@@ -2327,8 +2380,11 @@ classes = (
SEQUENCER_MT_strip_transform,
SEQUENCER_MT_strip_input,
SEQUENCER_MT_strip_lock_mute,
+ SEQUENCER_MT_color_tag_picker,
SEQUENCER_MT_context_menu,
+ SEQUENCER_PT_color_tag_picker,
+
SEQUENCER_PT_active_tool,
SEQUENCER_PT_strip,