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:
authorHarley Acheson <harley.acheson@gmail.com>2021-06-16 05:01:53 +0300
committerHarley Acheson <harley.acheson@gmail.com>2021-06-16 05:01:53 +0300
commitc8e331f45003352072789362241d2f5684737ec5 (patch)
treeaa567091e4bf697c1d901dd374612716637ea164 /source/blender/editors/space_view3d/space_view3d.c
parent4891da8ae22523c3ecb727f6f8be5647cbe0f51d (diff)
UI - LOCAL View3D overlay stats
This patch improves the 3DView statistics overlay to show LOCAL stats while in local view. This means the stats can vary between 3DViews and the statusbar when views are in local view, but this gives a much more accurate count of the objects, and their components, that you are directly working with rather than just scene values. Differential Revision: https://developer.blender.org/D8883 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/space_view3d/space_view3d.c')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 36901141497..d560c1f9978 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -331,6 +331,8 @@ static void view3d_free(SpaceLink *sl)
MEM_freeN(vd->localvd);
}
+ MEM_SAFE_FREE(vd->runtime.local_stats);
+
if (vd->runtime.properties_storage) {
MEM_freeN(vd->runtime.properties_storage);
}
@@ -346,6 +348,18 @@ static void view3d_init(wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
{
}
+static void view3d_exit(wmWindowManager *UNUSED(wm), ScrArea *area)
+{
+ BLI_assert(area->spacetype == SPACE_VIEW3D);
+ View3D *v3d = area->spacedata.first;
+ /* Happens when freeing. */
+ if (v3d == NULL) {
+ return;
+ }
+
+ MEM_SAFE_FREE(v3d->runtime.local_stats);
+}
+
static SpaceLink *view3d_duplicate(SpaceLink *sl)
{
View3D *v3do = (View3D *)sl;
@@ -1581,7 +1595,7 @@ static void space_view3d_listener(const wmSpaceTypeListenerParams *params)
}
}
-static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(area))
+static void space_view3d_refresh(const bContext *C, ScrArea *area)
{
Scene *scene = CTX_data_scene(C);
LightCache *lcache = scene->eevee.light_cache_data;
@@ -1590,6 +1604,9 @@ static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(area))
lcache->flag &= ~LIGHTCACHE_UPDATE_AUTO;
view3d_lightcache_update((bContext *)C);
}
+
+ View3D *v3d = (View3D *)area->spacedata.first;
+ MEM_SAFE_FREE(v3d->runtime.local_stats);
}
const char *view3d_context_dir[] = {
@@ -1697,6 +1714,7 @@ void ED_spacetype_view3d(void)
st->create = view3d_create;
st->free = view3d_free;
st->init = view3d_init;
+ st->exit = view3d_exit;
st->listener = space_view3d_listener;
st->refresh = space_view3d_refresh;
st->duplicate = view3d_duplicate;