diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-05-08 05:38:30 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-05-08 15:53:52 +0300 |
commit | 81c302bbff48b391b7f62ef7db233e9c7bd2adb2 (patch) | |
tree | 373b7644c0ea4a4936090d5730b34927a26ab106 /source/blender/blenloader | |
parent | 9dbe7bbe9a943ffd18fa670c4f68b4f90a6fc773 (diff) |
Action Editor: Initial support for a Properties Region
This commit adds some of the initial support for a properties region in the
Action Editor. There are currently no panels to display, as there is still
a lot of work required to port over the required internal architecture to
support the panels seen in the Graph Editor.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index f7d208a6a1b..efd167d49d5 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -137,6 +137,30 @@ static void do_version_constraints_stretch_to_limits(ListBase *lb) } } +static void do_version_action_editor_properties_region(ListBase *regionbase) +{ + ARegion *ar; + + for (ar = regionbase->first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_UI) { + /* already exists */ + return; + } + else if (ar->regiontype == RGN_TYPE_WINDOW) { + /* add new region here */ + ARegion *arnew = MEM_callocN(sizeof(ARegion), "buttons for action"); + + BLI_insertlinkbefore(regionbase, ar, arnew); + + arnew->regiontype = RGN_TYPE_UI; + arnew->alignment = RGN_ALIGN_RIGHT; + arnew->flag = RGN_FLAG_HIDDEN; + + return; + } + } +} + void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { @@ -1109,5 +1133,22 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) SEQ_END } + /* Adding "Properties" region to DopeSheet */ + for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + /* handle pushed-back space data first */ + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_ACTION) { + SpaceAction *saction = (SpaceAction *)sl; + do_version_action_editor_properties_region(&saction->regionbase); + } + } + + /* active spacedata info must be handled too... */ + if (sa->spacetype == SPACE_ACTION) { + do_version_action_editor_properties_region(&sa->regionbase); + } + } + } } } |