diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-01-22 16:54:44 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-01-22 17:06:18 +0300 |
commit | 6a49161c8c60cb63d9e3ed8dbe700163ff858436 (patch) | |
tree | 501c050d13bdbcdff7c6152a0946bb99617d5dc5 /source/blender/blenloader | |
parent | f559e3977e0773382cfb554956fe424f6050d495 (diff) |
VSE: Tool system integration
Add toolbar to sequencer regions.
A bit of refactoring has to be done in RNA space.
Currently there is only cut tool implemented to serve as template for
anybody who would like to add more.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 0754e59cb8a..7377f6a62a1 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -636,6 +636,29 @@ static ARegion *do_versions_add_region(int regiontype, const char *name) return ar; } +static void do_versions_area_ensure_tool_region(Main *bmain, + const short space_type, + const short region_flag) +{ + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == space_type) { + ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); + if (!ar) { + ARegion *header = BKE_area_find_region_type(sa, RGN_TYPE_HEADER); + ar = do_versions_add_region(RGN_TYPE_TOOLS, "tools region"); + BLI_insertlinkafter(regionbase, header, ar); + ar->alignment = RGN_ALIGN_LEFT; + ar->flag = region_flag; + } + } + } + } + } +} + static void do_version_bones_split_bbone_scale(ListBase *lb) { for (Bone *bone = lb->first; bone; bone = bone->next) { @@ -3738,7 +3761,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; /* All spaces that use tools must be eventually added. */ ARegion *ar = NULL; - if (ELEM(sl->spacetype, SPACE_VIEW3D, SPACE_IMAGE) && + if (ELEM(sl->spacetype, SPACE_VIEW3D, SPACE_IMAGE, SPACE_SEQ) && ((ar = do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOL_HEADER)) == NULL)) { /* Add tool header. */ ar = do_versions_add_region(RGN_TYPE_TOOL_HEADER, "tool header"); @@ -4338,6 +4361,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) { /* Keep this block, even when empty. */ + /* Sequencer Tool region */ + do_versions_area_ensure_tool_region(bmain, SPACE_SEQ, RGN_FLAG_HIDDEN); + /* Cloth internal springs */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { |