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:
authorRichard Antalik <richardantalik@gmail.com>2022-04-04 13:52:48 +0300
committerRichard Antalik <richardantalik@gmail.com>2022-04-04 13:56:43 +0300
commit277fa2f441f4ab2c00e7f329ba34a3466956647c (patch)
treebde615d956239337f88575dc7ce79d26f0f6cf4f /source/blender/blenloader
parent5a0b4e97e67446ef3a180acb0ad03b4cbf91b356 (diff)
VSE: Add channel headers
This patch adds channel region to VSE timeline area for drawing channel headers. It is synchronizedwith timeline region. 3 basic features are implemented - channel visibility, locking and name. Channel data is stored in `SeqTimelineChannel` which can be top-level owned by `Editing`, or it is owned by meta strip to support nesting. Strip properties are completely independent and channel properties are applied on top of particular strip property, thus overriding it. Implementation is separate from channel regions in other editors. This is mainly because style and topology is quite different in VSE. But also code seems to be much more readable this way. Currently channels use functions similar to VSE timeline to draw background to provide illusion of transparency, but only for background and sfra/efra regions. Great portion of this patch is change from using strip visibility and lock status to include channel state - this is facilitated by functions `SEQ_transform_is_locked` and `SEQ_render_is_muted` Originally this included changes in D14263, but patch was split for easier review. Reviewed By: fsiddi, Severin Differential Revision: https://developer.blender.org/D13836
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c7
-rw-r--r--source/blender/blenloader/intern/versioning_300.c62
-rw-r--r--source/blender/blenloader/intern/versioning_common.cc7
-rw-r--r--source/blender/blenloader/intern/versioning_common.h1
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c8
5 files changed, 78 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index b1c982649d2..0996b35c8ea 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -637,13 +637,6 @@ static ARegion *do_versions_find_region(ListBase *regionbase, int regiontype)
return region;
}
-static ARegion *do_versions_add_region(int regiontype, const char *name)
-{
- ARegion *region = MEM_callocN(sizeof(ARegion), name);
- region->regiontype = regiontype;
- return region;
-}
-
static void do_versions_area_ensure_tool_region(Main *bmain,
const short space_type,
const short region_flag)
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index eee0e7fbea8..d2b8c4330bc 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -53,6 +53,7 @@
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_node.h"
+#include "BKE_screen.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
@@ -62,6 +63,7 @@
#include "MEM_guardedalloc.h"
#include "readfile.h"
+#include "SEQ_channels.h"
#include "SEQ_iterator.h"
#include "SEQ_sequencer.h"
#include "SEQ_time.h"
@@ -944,6 +946,14 @@ static bool seq_transform_filter_set(Sequence *seq, void *UNUSED(user_data))
return true;
}
+static bool seq_meta_channels_ensure(Sequence *seq, void *UNUSED(user_data))
+{
+ if (seq->type == SEQ_TYPE_META) {
+ SEQ_channels_ensure(&seq->channels);
+ }
+ return true;
+}
+
static void do_version_subsurface_methods(bNode *node)
{
if (node->type == SH_NODE_SUBSURFACE_SCATTERING) {
@@ -2487,6 +2497,58 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 302, 9)) {
+ /* Sequencer channels region. */
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (sl->spacetype != SPACE_SEQ) {
+ continue;
+ }
+ if (ELEM(((SpaceSeq *)sl)->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW)) {
+ continue;
+ }
+
+ ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
+ &sl->regionbase;
+ ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
+ if (!region) {
+ ARegion *tools_region = BKE_area_find_region_type(area, RGN_TYPE_TOOLS);
+ region = do_versions_add_region(RGN_TYPE_CHANNELS, "channels region");
+ BLI_insertlinkafter(regionbase, tools_region, region);
+ region->alignment = RGN_ALIGN_LEFT;
+ region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
+ }
+
+ ARegion *timeline_region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
+ if (timeline_region != NULL) {
+ timeline_region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
+ }
+ }
+ }
+ }
+
+ /* Initialize channels. */
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ Editing *ed = SEQ_editing_get(scene);
+ if (ed == NULL) {
+ continue;
+ }
+ SEQ_channels_ensure(&ed->channels);
+ SEQ_for_each_callback(&scene->ed->seqbase, seq_meta_channels_ensure, NULL);
+
+ ed->displayed_channels = &ed->channels;
+
+ ListBase *previous_channels = &ed->channels;
+ LISTBASE_FOREACH (MetaStack *, ms, &ed->metastack) {
+ ms->old_channels = previous_channels;
+ previous_channels = &ms->parseq->channels;
+ /* If `MetaStack` exists, active channels must point to last link. */
+ ed->displayed_channels = &ms->parseq->channels;
+ }
+ }
+ }
+
/**
* Versioning code until next subversion bump goes here.
*
diff --git a/source/blender/blenloader/intern/versioning_common.cc b/source/blender/blenloader/intern/versioning_common.cc
index 281769410bd..d2a55f6f37e 100644
--- a/source/blender/blenloader/intern/versioning_common.cc
+++ b/source/blender/blenloader/intern/versioning_common.cc
@@ -225,3 +225,10 @@ void version_socket_update_is_used(bNodeTree *ntree)
link->tosock->flag |= SOCK_IN_USE;
}
}
+
+ARegion *do_versions_add_region(int regiontype, const char *name)
+{
+ ARegion *region = (ARegion *)MEM_callocN(sizeof(ARegion), name);
+ region->regiontype = regiontype;
+ return region;
+}
diff --git a/source/blender/blenloader/intern/versioning_common.h b/source/blender/blenloader/intern/versioning_common.h
index 939b87823d4..c8c7dcc7cff 100644
--- a/source/blender/blenloader/intern/versioning_common.h
+++ b/source/blender/blenloader/intern/versioning_common.h
@@ -88,6 +88,7 @@ struct bNodeSocket *version_node_add_socket_if_not_exist(struct bNodeTree *ntree
* the flag on all sockets after changes to the node tree.
*/
void version_socket_update_is_used(bNodeTree *ntree);
+ARegion *do_versions_add_region(int regiontype, const char *name);
#ifdef __cplusplus
}
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index ec76f516780..dcf2ce4438d 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -328,6 +328,14 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
if (!USER_VERSION_ATLEAST(302, 8)) {
btheme->space_node.grid_levels = U_theme_default.space_node.grid_levels;
}
+
+ if (!USER_VERSION_ATLEAST(302, 9)) {
+ FROM_DEFAULT_V4_UCHAR(space_sequencer.list);
+ FROM_DEFAULT_V4_UCHAR(space_sequencer.list_title);
+ FROM_DEFAULT_V4_UCHAR(space_sequencer.list_text);
+ FROM_DEFAULT_V4_UCHAR(space_sequencer.list_text_hi);
+ }
+
/**
* Versioning code until next subversion bump goes here.
*