Patch [#30681] Improved Display of Header Statistics by Harley Acheson (harley),...
authorThomas Dinges <blender@dingto.org>
Mon, 30 Apr 2012 18:37:34 +0000 (18:37 +0000)
committerThomas Dinges <blender@dingto.org>
Mon, 30 Apr 2012 18:37:34 +0000 (18:37 +0000)
* This patch changes the header statistics to something more meaningful
* Removed the blender.org string, version info is sufficient + not all Blender versions come directly from blender.org
* Use names like Faces, rather than abbreviations.
* Show Verts, Edges and Faces, independent of the current selection method in edit mode.
* Added TriCount into the header.

* Small change to the patch by myself, added a "v" in front of the version number.

source/blender/blenkernel/intern/blender.c
source/blender/editors/space_info/info_stats.c

index 198d644b21163e6629a3665126b1d1591a35bec4..2b741d6d8eb25e361d15dfe9e11c8ba616e721f0 100644 (file)
@@ -129,9 +129,9 @@ void initglobals(void)
        strcpy(G.ima, "//");
 
        if (BLENDER_SUBVERSION)
-               BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION);
+               BLI_snprintf(versionstr, sizeof(versionstr), "v%d.%02d.%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
        else
-               BLI_snprintf(versionstr, sizeof(versionstr), "blender.org %d", BLENDER_VERSION);
+               BLI_snprintf(versionstr, sizeof(versionstr), "v%d.%02d", BLENDER_VERSION/100, BLENDER_VERSION%100);
 
 #ifdef _WIN32  // FULLSCREEN
        G.windowstate = G_WINDOWSTATE_USERDEF;
index 2ef8f6c306c5f31565871fb87316cbca0ebcb951..0cc212f9c3401647bf06a0d4562d6548c99fb988 100644 (file)
@@ -60,8 +60,9 @@ typedef struct SceneStats {
        int totedge, totedgesel;
        int totface, totfacesel;
        int totbone, totbonesel;
-       int totobj, totobjsel;
-       int totmesh, totlamp, totcurve;
+       int totobj,  totobjsel;
+       int totlamp, totlampsel; 
+       int tottri, totmesh, totcurve;
 
        char infostr[512];
 } SceneStats;
@@ -94,6 +95,9 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
                }
                case OB_LAMP:
                        stats->totlamp += totob;
+                       if (sel) {
+                               stats->totlampsel += totob;
+                       }
                        break;
                case OB_SURF:
                case OB_CURVE:
@@ -150,6 +154,8 @@ static void stats_object_edit(Object *obedit, SceneStats *stats)
                
                stats->totface = em->bm->totface;
                stats->totfacesel = em->bm->totfacesel;
+
+               stats->tottri = em->tottri;
        }
        else if (obedit->type == OB_ARMATURE) {
                /* Armature Edit */
@@ -363,31 +369,25 @@ static void stats_string(Scene *scene)
                        s += sprintf(s, "(Key) ");
 
                if (scene->obedit->type == OB_MESH) {
-                       if (scene->toolsettings->selectmode & SCE_SELECT_VERTEX)
-                               s += sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
-                                            stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
-                       else if (scene->toolsettings->selectmode & SCE_SELECT_EDGE)
-                               s += sprintf(s, "Ed:%d-%d | Fa:%d-%d",
-                                            stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
-                       else
-                               s += sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface);
+                       s += sprintf(s, "Verts:%d/%d | Edges:%d/%d | Faces:%d/%d | Tris:%d",
+                            stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface, stats->tottri);
                }
                else if (scene->obedit->type == OB_ARMATURE) {
-                       s += sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
+                       s += sprintf(s, "Verts:%d/%d | Bones:%d/%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
                }
                else {
-                       s += sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert);
+                       s += sprintf(s, "Verts:%d/%d", stats->totvertsel, stats->totvert);
                }
 
                strcat(s, memstr);
        }
        else if (ob && (ob->mode & OB_MODE_POSE)) {
-               s += sprintf(s, "Bo:%d-%d %s",
+               s += sprintf(s, "Bones:%d/%d %s",
                             stats->totbonesel, stats->totbone, memstr);
        }
        else {
-               s += sprintf(s, "Ve:%d | Fa:%d | Ob:%d-%d | La:%d%s",
-                            stats->totvert, stats->totface, stats->totobjsel, stats->totobj, stats->totlamp, memstr);
+               s += sprintf(s, "Verts:%d | Faces:%d | Objects:%d/%d | Lamps:%d/%d%s",
+                            stats->totvert, stats->totface, stats->totobjsel, stats->totobj, stats->totlampsel, stats->totlamp, memstr);
        }
 
        if (ob)