Page MenuHome

VSE: Add color tags to strips
ClosedPublic

Authored by Falk David (filedescriptor) on Sep 5 2021, 4:20 PM.

Details

Summary

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 8 possible colors and two ways of changing the color tag through the UI.

The current colors still need to be changed.

You can change the color through the right-click context menu:

Or in the strip side panel next to the strip name:

Overlay setting:

Theme settings:

It also covers versioning, so strips in older files should get the default color tag assigned.

Diff Detail

Repository
rB Blender
Branch
temp-vse-colored-strips (branched from master)
Build Status
Buildable 16822
Build 16822: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@Falk David (filedescriptor) Yes that's what I was thinking, then I didn't understand the reply from Francesco at all :)

  • Remove default value
  • Merge branch 'master' into temp-vse-colored-strips
  • Add strip_color userpref, property and icons
  • Versioning and default values
  • Add operator to change strip color
  • Add operator to context menu
  • Merge branch 'master' into temp-vse-colored-strips

Updated the diff to use a palette system instead of custom colors. The code is based on how this is handled with collections.

I am using the default colors from the collections, but this would have to be revisited by the UI team or by through a community feedback.
Also, I tried to add the color picker to the Strip side panel, but it doesn't work really well. You end up with buttons and icons that don't scale with the UI... It's a big mess.

Now I am not sure if the overlay option "Display Color Mode" makes sense any more. It might be better to remove that with this system.

From the images, it looks great, however I think you should give exposing the palette options in the sidebar one more thought. The strip color is a strip property and strip properties belongs in the strip sidebar. Have you tried to add a color coding button at the end of then name before the mute button, and clicking it should open a drop down containing the palette? Something like this?

Falk David (filedescriptor) edited the summary of this revision. (Show Details)
  • WIP: Add color tag picker in strip panel

@Peter Fog (tintwotin) Ok I liked the idea with the subpanel and tried it out. It works better than expected, but there are still a few issues like the space at the left. I'm not an expert when it comes to python UI related stuff so I'm guessing that you can do better than what I have right now.

  • Icon when no color is selected + small UI tweaks
Falk David (filedescriptor) planned changes to this revision.Sep 13 2021, 12:10 PM

The theme panel with the colors should be moved into the "Video Sequencer" as a subsection.

  • Merge branch 'master' into temp-vse-colored-strips
  • Fix merge issue
  • Replace color mode with color tag boolean toggle
  • Make the color picker panel prettier
Falk David (filedescriptor) retitled this revision from VSE: Add option to color vse strips individually to VSE: Add color tags to strips.Sep 15 2021, 10:42 AM
Falk David (filedescriptor) edited the summary of this revision. (Show Details)

I am pretty happy with what I got now. Feedback is very welcome!
Note that the color palette is still the same as the "collection color tag" one. I am sure that we will need better colors down the line. (Maybe @Pablo Vazquez (pablovazquez) can help out?)

@Richard Antalik (ISS) If there is still a possibility to get this into 3.0 I will try my best to work on this as much as you need me to.

Campbell Barton (campbellbarton) requested changes to this revision.Sep 15 2021, 11:17 AM
Campbell Barton (campbellbarton) added inline comments.
release/scripts/startup/bl_ui/space_sequencer.py
1020–1021

Prefer percentage formatting over f-strings.

1054

trailing space.

1056

single quotes for enum values.

source/blender/sequencer/intern/utils.c
610–611

scene and seq arguments can be const.

615

Color tag should be bounds checked (files from the future may have more colors).

(uint)seq->color_tag < SEQUENCE_COLOR_TOT is sufficient and accounts for -1 too.

This revision now requires changes to proceed.Sep 15 2021, 11:17 AM
  • Merge branch 'master' into temp-vse-colored-strips
  • Code review comments
Falk David (filedescriptor) marked 5 inline comments as done.Sep 15 2021, 3:24 PM
This revision is now accepted and ready to land.Sep 15 2021, 3:31 PM

This is a good improvement!
In the context menu I suggest to try nesting the color swatch in a submenu, to prevent it from being visible all the time.
The full color spectrum is eye-catching and creates visual noise in the navigation. I understand there is a tradeoff between speed of access and visual noise.

  • Add submenu for color picker
  • Merge branch 'master' into temp-vse-colored-strips
  • Enable "Show Color Tags" by default
source/blender/blenloader/intern/versioning_300.c
1128–1130

This isn't setting values for nested strips. Use SEQ_for_each_callback

source/blender/blenloader/intern/versioning_300.c
1128–1130
NOTE: A recursive function would also be fine (used often in sequence versioning).
  • Merge branch 'master' into temp-vse-colored-strips
  • Do version recursively so we also handle meta strips

@Francesco Siddi (fsiddi) I changed it so the picker is now in the "Set Color Tag" submenu. This is also exposed in the "Strip" menu for consistency.

Thank you for taking the suggestions on board @Falk David (filedescriptor)!
I have one final suggestion, which is to add a shade of grey to the palette.

A note for future iterations: in order to use the palette to convey multiple (orthogonal) meanings, such as shot grouping, production stages, duration thresholds, proxy vs online, it will be useful to implement a rule-based color system. This concept has been brought up several time by Ton in other contexts, and it would apply here too. This is a good topic to look into during the Blender 3 series.

@Francesco Siddi (fsiddi) No problem :) Would the shade of grey replace one of the existing colors or would it be a new 9th color?

I suggest to make it a 9th color, after brown.

I can't seem to understand why, but the patch consistently crashes for me, when I choose the "Video Editing" app template. I think it has to do with the fact that there are no strips in the default file. When testing, I loaded a file that had some strips already in the timeline.

@Campbell Barton (campbellbarton) any idea what could be happening?

  • Merge branch 'master' into temp-vse-colored-strips
  • Add new color: grey

I noticed an issue:

  • Load Blender with factory settings
  • New File > Video Editing
  • Crash

Can you reproduce?

I can't seem to understand why, but the patch consistently crashes for me, when I choose the "Video Editing" app template. I think it has to do with the fact that there are no strips in the default file. When testing, I loaded a file that had some strips already in the timeline.

@Campbell Barton (campbellbarton) any idea what could be happening?

@Francesco Siddi (fsiddi) yes, can reproduce, but can't figure out what's wrong. The crash happens whithin the initialization of the editor UI.

I noticed an issue:

  • Load Blender with factory settings
  • New File > Video Editing
  • Crash

Can you reproduce?

It's not crashing for me, whats the stack-trace?

Richard Antalik (ISS) requested changes to this revision.Sep 21 2021, 3:10 PM

Sorry for getting late to this, I have only few requests for change here. Other than that I think this patch works well.

As for crash mentioned earlier, I can't reproduce either, this is after resolving conflicts and rebasing on latest master, because I was getting some build errors at current revision.

source/blender/editors/space_sequencer/sequencer_draw.c
107–230

What is reason for moving this to SEQ_utils.h? these functions usually handle sequencer internal workings while this function is only called from sequencer_draw.c and could remain static.

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

I think, that this is best to set in SEQ_sequence_alloc() for all strip types so you can remove this from strip_add.c too.

This revision now requires changes to proceed.Sep 21 2021, 3:10 PM
Falk David (filedescriptor) planned changes to this revision.Sep 24 2021, 4:56 PM

Seems like the overlays in the sequencer have been split into preview overlays and timeline overlays. I will move the overlay to show the color tags to the timeline overlays.

Sorry for getting late to this, I have only few requests for change here. Other than that I think this patch works well.

As for crash mentioned earlier, I can't reproduce either, this is after resolving conflicts and rebasing on latest master, because I was getting some build errors at current revision.

Yea I also had to fix some merge issues. It seems like with latest master, the crash is gone.
As for the comments: I moved the function into SEQ_utils because initially I needed to set a custom color for each strip based on the theme. Since that is no longer the case, I can move the function back to the draw code. Just haven't done that yet.

Hi @Falk David (filedescriptor) - will you be able to implement the suggested changes soon?
It would be great to have this feature merged before bcon2!

@Francesco Siddi (fsiddi) I'm on holiday until Friday! I was also hoping to get this done before bcon2 :( There is a chance though that I can finish the changes tomorrow on my trip back.

  • Set initial color_tag in SEQ_sequence_alloc
  • Move function color3ubv_from_seq back to original place.
  • Cleanup unused include, whitespace

Fixed my requests, went over patch again, and I don't see any other issues, so for me this is good to go.

This revision is now accepted and ready to land.Sep 29 2021, 12:31 PM
This revision was automatically updated to reflect the committed changes.