[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46126] trunk/blender/source/blender: Patch [#30681] Improved Display of Header Statistics by Harley Acheson ( harley), thanks!

Thomas Dinges blender at dingto.org
Mon Apr 30 20:37:35 CEST 2012


Revision: 46126
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46126
Author:   dingto
Date:     2012-04-30 18:37:34 +0000 (Mon, 30 Apr 2012)
Log Message:
-----------
Patch [#30681] Improved Display of Header Statistics by Harley Acheson (harley), thanks!

* 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. 

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/blender.c
    trunk/blender/source/blender/editors/space_info/info_stats.c

Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/blender.c	2012-04-30 16:29:01 UTC (rev 46125)
+++ trunk/blender/source/blender/blenkernel/intern/blender.c	2012-04-30 18:37:34 UTC (rev 46126)
@@ -129,9 +129,9 @@
 	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;

Modified: trunk/blender/source/blender/editors/space_info/info_stats.c
===================================================================
--- trunk/blender/source/blender/editors/space_info/info_stats.c	2012-04-30 16:29:01 UTC (rev 46125)
+++ trunk/blender/source/blender/editors/space_info/info_stats.c	2012-04-30 18:37:34 UTC (rev 46126)
@@ -60,8 +60,9 @@
 	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 @@
 		}
 		case OB_LAMP:
 			stats->totlamp += totob;
+			if (sel) {
+				stats->totlampsel += totob;
+			}
 			break;
 		case OB_SURF:
 		case OB_CURVE:
@@ -150,6 +154,8 @@
 		
 		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 @@
 			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)




More information about the Bf-blender-cvs mailing list