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:
Diffstat (limited to 'source/blender/editors/space_outliner/space_outliner.c')
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 2ed834a15dd..ce772043e3b 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -102,18 +102,25 @@ static void outliner_main_region_free(ARegion *UNUSED(region))
}
static void outliner_main_region_listener(wmWindow *UNUSED(win),
- ScrArea *UNUSED(area),
+ ScrArea *area,
ARegion *region,
wmNotifier *wmn,
const Scene *UNUSED(scene))
{
+ SpaceOutliner *space_outliner = area->spacedata.first;
+
/* context changes */
switch (wmn->category) {
case NC_SCENE:
switch (wmn->data) {
case ND_OB_ACTIVE:
case ND_OB_SELECT:
- ED_region_tag_redraw_no_rebuild(region);
+ if (outliner_requires_rebuild_on_select_or_active_change(space_outliner)) {
+ ED_region_tag_redraw(region);
+ }
+ else {
+ ED_region_tag_redraw_no_rebuild(region);
+ }
break;
case ND_OB_VISIBLE:
case ND_OB_RENDER:
@@ -344,11 +351,21 @@ static void outliner_free(SpaceLink *sl)
if (space_outliner->treehash) {
BKE_outliner_treehash_free(space_outliner->treehash);
}
+
+ if (space_outliner->runtime) {
+ MEM_freeN(space_outliner->runtime);
+ }
}
/* spacetype; init callback */
-static void outliner_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
+static void outliner_init(wmWindowManager *UNUSED(wm), ScrArea *area)
{
+ SpaceOutliner *space_outliner = area->spacedata.first;
+
+ if (space_outliner->runtime == NULL) {
+ space_outliner->runtime = MEM_callocN(sizeof(*space_outliner->runtime),
+ "SpaceOutliner_Runtime");
+ }
}
static SpaceLink *outliner_duplicate(SpaceLink *sl)
@@ -362,6 +379,10 @@ static SpaceLink *outliner_duplicate(SpaceLink *sl)
space_outliner_new->sync_select_dirty = WM_OUTLINER_SYNC_SELECT_FROM_ALL;
+ if (space_outliner->runtime) {
+ space_outliner_new->runtime = MEM_dupallocN(space_outliner->runtime);
+ }
+
return (SpaceLink *)space_outliner_new;
}