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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-03 14:32:36 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-03 22:30:35 +0300
commitd7c2b78822ff20fb78418c43d6badd692fa98784 (patch)
treec1f8b9a0580afc173dd0829615f74a94a3254589 /source/blender/blenloader
parent9b01e7bc27c4a8c8c9f95aa074f458f3e734d23b (diff)
UI: add subpanel support.
In the Python API, any panel becomes a subpanel by setting bl_parent_id to the name of the parent panel. These subpanels can contain advanced or less commonly used settings.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c17
-rw-r--r--source/blender/blenloader/intern/writefile.c13
2 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d2542e977e3..b0a1789eb7e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6396,19 +6396,24 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd)
/* *********** READ AREA **************** */
-static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
+static void direct_link_panel_list(FileData *fd, ListBase *lb)
{
- Panel *pa;
- uiList *ui_list;
-
- link_list(fd, &ar->panels);
+ link_list(fd, lb);
- for (pa = ar->panels.first; pa; pa = pa->next) {
+ for (Panel *pa = lb->first; pa; pa = pa->next) {
pa->paneltab = newdataadr(fd, pa->paneltab);
pa->runtime_flag = 0;
pa->activedata = NULL;
pa->type = NULL;
+ direct_link_panel_list(fd, &pa->children);
}
+}
+
+static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
+{
+ uiList *ui_list;
+
+ direct_link_panel_list(fd, &ar->panels);
link_list(fd, &ar->panels_category_active);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index de1699e24b7..fb7b3e47153 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2762,14 +2762,19 @@ static void write_soops(WriteData *wd, SpaceOops *so)
}
}
+static void write_panel_list(WriteData *wd, ListBase *lb)
+{
+ for (Panel *pa = lb->first; pa; pa = pa->next) {
+ writestruct(wd, DATA, Panel, 1, pa);
+ write_panel_list(wd, &pa->children);
+ }
+}
+
static void write_area_regions(WriteData *wd, ScrArea *area)
{
for (ARegion *region = area->regionbase.first; region; region = region->next) {
write_region(wd, region, area->spacetype);
-
- for (Panel *pa = region->panels.first; pa; pa = pa->next) {
- writestruct(wd, DATA, Panel, 1, pa);
- }
+ write_panel_list(wd, &region->panels);
for (PanelCategoryStack *pc_act = region->panels_category_active.first; pc_act; pc_act = pc_act->next) {
writestruct(wd, DATA, PanelCategoryStack, 1, pc_act);