[Bf-blender-cvs] [b54e741a8b5] master: UI: Add light count to viewport statistics

Falk David noreply at git.blender.org
Tue Aug 3 09:43:17 CEST 2021


Commit: b54e741a8b5655208ae666653639885afe15c5e8
Author: Falk David
Date:   Tue Aug 3 09:41:08 2021 +0200
Branches: master
https://developer.blender.org/rBb54e741a8b5655208ae666653639885afe15c5e8

UI: Add light count to viewport statistics

Even though lights were part of `SceneStats`, they were not used when
rBfd10ac9acaa0 was committed.

This patch adds the light count back into the statistics. When a light is
the active object, it will display the total number of lights in the
scene, as well as how many lights are currently selected.

{F10141354}

Reviewed By: #user_interface, Severin, Blendify, harley

Maniphest Tasks: T88512

Differential Revision: https://developer.blender.org/D11387

===================================================================

M	source/blender/editors/space_info/info_stats.c

===================================================================

diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index d7671a372c6..983e04127e0 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -764,6 +764,7 @@ void ED_info_draw_stats(
     FRAMES,
     STROKES,
     POINTS,
+    LIGHTS,
     MAX_LABELS_COUNT
   };
   char labels[MAX_LABELS_COUNT][64];
@@ -779,6 +780,7 @@ void ED_info_draw_stats(
   STRNCPY(labels[FRAMES], IFACE_("Frames"));
   STRNCPY(labels[STROKES], IFACE_("Strokes"));
   STRNCPY(labels[POINTS], IFACE_("Points"));
+  STRNCPY(labels[LIGHTS], IFACE_("Lights"));
 
   int longest_label = 0;
   int i;
@@ -832,6 +834,9 @@ void ED_info_draw_stats(
       stats_row(col1, labels[FACES], col2, stats_fmt.totfacesculpt, stats_fmt.totface, y, height);
     }
   }
+  else if ((ob) && (ob->type == OB_LAMP)) {
+    stats_row(col1, labels[LIGHTS], col2, stats_fmt.totlampsel, stats_fmt.totlamp, y, height);
+  }
   else {
     stats_row(col1, labels[VERTS], col2, stats_fmt.totvert, NULL, y, height);
     stats_row(col1, labels[EDGES], col2, stats_fmt.totedge, NULL, y, height);



More information about the Bf-blender-cvs mailing list