diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-12-30 22:29:25 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-12-30 22:29:25 +0400 |
commit | ae9d6e08130e56157cf3979bff81e6d2bf778946 (patch) | |
tree | 26d0f227ee1564a523d49a2d23fab2f6903f6c37 /source/blender/editors/space_info/info_stats.c | |
parent | 67d27db4a1ce276c394fd3fdfab221018d4240ce (diff) |
Modify info stats for dynamic-topology sculpt mode
Format is like this: "Verts:8 | Tris:12 | Cube"
Diffstat (limited to 'source/blender/editors/space_info/info_stats.c')
-rw-r--r-- | source/blender/editors/space_info/info_stats.c | 20 |
1 files changed, 20 insertions, 0 deletions
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); |