Page MenuHome

UI: Statistics Changes
ClosedPublic

Authored by Harley Acheson (harley) on Apr 26 2020, 5:27 AM.

Details

Summary

D7410 moved the stats into the 3D Viewport as an overlay while purposely keeping the display and logic as close to the same as possible. This patch makes some minor cosmetic changes and proposes a couple larger changes.

First the cosmetic:

  • Spaces added to either side of the "/" in the list to separate the numbers better.
  • Vertical Line height of the info and stats lines increased slightly as they looked a bit cramped.
  • Vertical space between info text lines and stats block increased slightly to separate the block better.

You can see these visual changes well in the following capture (at 1.5 UI scale):

Always Show Objects

It makes some sense to always show the "objects" line in the stats. Cosmetically it means that the block does not seem to shift up a line every time you enter Edit mode. But also nice to show many items are being edited if editing multiples.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Apr 26 2020, 5:27 AM
Harley Acheson (harley) created this revision.
This revision is now accepted and ready to land.Apr 26 2020, 8:02 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/editors/space_info/info_stats.c
380–383

This has a significant performance impact for complex scenes.

At the very least do not loop over all objects twice in object mode. But I don't think it's good to have this loop at all in edit and other modes.

504

The stats are being computed here for one particular 3D viewport and then used for others where that information is not valid.

Computing it separately for each 3D viewport will have a significant performance impact as well however if stats are shown in multiple viewports.

Brecht Van Lommel (brecht) requested changes to this revision.Apr 26 2020, 8:29 PM
This revision now requires changes to proceed.Apr 26 2020, 8:29 PM
Harley Acheson (harley) planned changes to this revision.Apr 26 2020, 9:28 PM

@Brecht Van Lommel (brecht) - do not loop over all objects twice in object mode. But I don't think it's good to have this loop at all in edit and other modes.

Yes, I have ideas about this.

The stats are being computed here for one particular 3D viewport and then used for others where that information is not valid.
Computing it separately for each 3D viewport will have a significant performance impact as well however if stats are shown in multiple viewports.

Ah yes, I see that hiding of objects is per-scene, while Local View is per viewport. So this would mean that we probably can't have Local stats for Local view since those stats are stored per view layer. Will give it another look.

Thank you for continuing to improve the new stats display!

It looks like you'll have shift the stats even further down though (or shift the "Rendering" text someplace else). Enable Cycles and switch to Rendered mode in the viewport:

@Jesse Yurkovich (deadpin) - It looks like you'll have shift the stats even further down though (or shift the "Rendering" text someplace else).

Interesting! The text and stats are all part of the same related block, printing one after the other. So guessing that Cycles notification is just stuck on top somewhere else. Weird to have that notification there at all though since all similar things go elsewhere. Will have to take a look. Thanks!

Only adds the "Objects" line for Edit Mode and does very minimal extra work to do so. Although, to be fair, while in Edit mode it is specifically showing how many objects are actually being edited.

I also changed the logic around the calling of stats_update when the stats don't already exist in ED_info_draw_stats(). BKE_scene_get_depsgraph() was being called every time, whether needed or not. And the return if the interface was moved - there is no reason to return on interface_locked if stats_update() does not need to be called.

@Brecht Van Lommel (brecht) - At the very least do not loop over all objects twice in object mode

Yes, no longer do that.

The stats are being computed here for one particular 3D viewport

Yes, I have taken out the idea of showing local stats for Local View. For now. But I think there might be a nice way to approach this later.

Harley Acheson (harley) edited the summary of this revision. (Show Details)Apr 28 2020, 5:49 AM
This revision is now accepted and ready to land.Apr 30 2020, 11:45 AM
This revision was automatically updated to reflect the committed changes.