[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53443] trunk/blender/source/blender/ editors/space_info/info_stats.c: Modify info stats for dynamic-topology sculpt mode

Nicholas Bishop nicholasbishop at gmail.com
Sun Dec 30 19:29:26 CET 2012


Revision: 53443
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53443
Author:   nicholasbishop
Date:     2012-12-30 18:29:25 +0000 (Sun, 30 Dec 2012)
Log Message:
-----------
Modify info stats for dynamic-topology sculpt mode

Format is like this: "Verts:8 | Tris:12 | Cube"

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

Modified: trunk/blender/source/blender/editors/space_info/info_stats.c
===================================================================
--- trunk/blender/source/blender/editors/space_info/info_stats.c	2012-12-30 18:29:07 UTC (rev 53442)
+++ trunk/blender/source/blender/editors/space_info/info_stats.c	2012-12-30 18:29:25 UTC (rev 53443)
@@ -48,6 +48,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_key.h"
 #include "BKE_mesh.h"
+#include "BKE_paint.h"
 #include "BKE_particle.h"
 #include "BKE_tessmesh.h"
 
@@ -246,6 +247,12 @@
 	}
 }
 
+static void stats_object_sculpt_dynamic_topology(Object *ob, SceneStats *stats)
+{
+	stats->totvert = ob->sculpt->bm->totvert;
+	stats->tottri = ob->sculpt->bm->totface;
+}
+
 static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
 {
 	if (base->flag & SELECT) stats->totobjsel++;
@@ -305,6 +312,12 @@
 	}
 }
 
+static int stats_is_object_dynamic_topology_sculpt(Object *ob)
+{
+	return (ob && (ob->mode & OB_MODE_SCULPT) &&
+			ob->sculpt && ob->sculpt->bm);
+}
+
 /* Statistics displayed in info header. Called regularly on scene changes. */
 static void stats_update(Scene *scene)
 {
@@ -320,6 +333,10 @@
 		/* Pose Mode */
 		stats_object_pose(ob, &stats);
 	}
+	else if (stats_is_object_dynamic_topology_sculpt(ob)) {
+		/* Dynamic-topology sculpt mode */
+		stats_object_sculpt_dynamic_topology(ob, &stats);
+	}
 	else {
 		/* Objects */
 		for (base = scene->base.first; base; base = base->next)
@@ -374,6 +391,9 @@
 		s += sprintf(s, "Bones:%d/%d %s",
 		             stats->totbonesel, stats->totbone, memstr);
 	}
+	else if (stats_is_object_dynamic_topology_sculpt(ob)) {
+		s += sprintf(s, "Verts:%d | Tris:%d", stats->totvert, stats->tottri);
+	}
 	else {
 		s += sprintf(s, "Verts:%d | Faces:%d| Tris:%d | Objects:%d/%d | Lamps:%d/%d%s",
 		             stats->totvert, stats->totface, stats->tottri, stats->totobjsel, stats->totobj, stats->totlampsel, stats->totlamp, memstr);




More information about the Bf-blender-cvs mailing list