From ae9d6e08130e56157cf3979bff81e6d2bf778946 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 30 Dec 2012 18:29:25 +0000 Subject: Modify info stats for dynamic-topology sculpt mode Format is like this: "Verts:8 | Tris:12 | Cube" --- source/blender/editors/space_info/info_stats.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/blender/editors/space_info') diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 73a43ee35ed..490d08284d2 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -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_pose(Object *ob, SceneStats *stats) } } +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 void stats_dupli_object(Base *base, Object *ob, SceneStats *stats) } } +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 @@ static void stats_update(Scene *scene) /* 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 @@ static void stats_string(Scene *scene) 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); -- cgit v1.2.3