~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/editors/space_info/info_stats.c

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * $Id: info_stats.c 27676 2010-03-23 14:09:09Z campbellbarton $
3
 
 *
 
1
/*
4
2
 * ***** BEGIN GPL LICENSE BLOCK *****
5
3
 *
6
4
 * This program is free software; you can redistribute it and/or
22
20
 * ***** END GPL LICENSE BLOCK *****
23
21
 */
24
22
 
 
23
/** \file blender/editors/space_info/info_stats.c
 
24
 *  \ingroup spinfo
 
25
 */
 
26
 
 
27
 
25
28
#include <stdio.h>
26
29
#include <string.h>
27
30
 
31
34
#include "DNA_curve_types.h"
32
35
#include "DNA_group_types.h"
33
36
#include "DNA_lattice_types.h"
 
37
#include "DNA_mesh_types.h"
34
38
#include "DNA_meta_types.h"
35
39
#include "DNA_scene_types.h"
36
40
 
 
41
#include "BLI_utildefines.h"
 
42
 
37
43
#include "BKE_anim.h"
38
 
#include "BKE_context.h"
 
44
#include "BKE_blender.h"
 
45
#include "BKE_curve.h"
39
46
#include "BKE_displist.h"
40
47
#include "BKE_DerivedMesh.h"
41
48
#include "BKE_key.h"
42
49
#include "BKE_mesh.h"
43
50
#include "BKE_particle.h"
44
 
#include "BKE_utildefines.h"
 
51
#include "BKE_tessmesh.h"
45
52
 
 
53
#include "ED_info.h"
46
54
#include "ED_armature.h"
47
55
#include "ED_mesh.h"
48
56
 
49
 
#include "BLI_editVert.h"
50
57
 
51
58
typedef struct SceneStats {
52
59
        int totvert, totvertsel;
61
68
 
62
69
static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
63
70
{
64
 
        switch(ob->type) {
65
 
        case OB_MESH: {
66
 
                /* we assume derivedmesh is already built, this strictly does stats now. */
67
 
                DerivedMesh *dm= ob->derivedFinal;
68
 
                int totvert, totedge, totface;
69
 
 
70
 
                stats->totmesh +=totob;
71
 
 
72
 
                if(dm) {
73
 
                        totvert = dm->getNumVerts(dm);
74
 
                        totedge = dm->getNumEdges(dm);
75
 
                        totface = dm->getNumFaces(dm);
76
 
 
77
 
                        stats->totvert += totvert*totob;
78
 
                        stats->totedge += totedge*totob;
79
 
                        stats->totface += totface*totob;
80
 
 
81
 
                        if(sel) {
82
 
                                stats->totvertsel += totvert;
83
 
                                stats->totfacesel += totface;
84
 
                        }
85
 
                }
86
 
                break;
87
 
        }
88
 
        case OB_LAMP:
89
 
                stats->totlamp += totob;
90
 
                break;
91
 
        case OB_SURF:
92
 
        case OB_CURVE:
93
 
        case OB_FONT: {
94
 
                Curve *cu= ob->data;
95
 
                int tot= 0, totf= 0;
96
 
 
97
 
                stats->totcurve += totob;
98
 
 
99
 
                if(cu->disp.first)
100
 
                        count_displist(&cu->disp, &tot, &totf);
101
 
 
102
 
                tot *= totob;
103
 
                totf *= totob;
104
 
 
105
 
                stats->totvert+= tot;
106
 
                stats->totface+= totf;
107
 
 
108
 
                if(sel) {
109
 
                        stats->totvertsel += tot;
110
 
                        stats->totfacesel += totf;
111
 
                }
112
 
                break;
113
 
        }
114
 
        case OB_MBALL: {
115
 
                int tot= 0, totf= 0;
116
 
 
117
 
                count_displist(&ob->disp, &tot, &totf);
118
 
 
119
 
                tot *= totob;
120
 
                totf *= totob;
121
 
 
122
 
                stats->totvert += tot;
123
 
                stats->totface += totf;
124
 
 
125
 
                if(sel) {
126
 
                        stats->totvertsel += tot;
127
 
                        stats->totfacesel += totf;
128
 
                }
129
 
                break;
130
 
        }
 
71
        switch (ob->type) {
 
72
                case OB_MESH: {
 
73
                        /* we assume derivedmesh is already built, this strictly does stats now. */
 
74
                        DerivedMesh *dm = ob->derivedFinal;
 
75
                        int totvert, totedge, totface;
 
76
 
 
77
                        stats->totmesh += totob;
 
78
 
 
79
                        if (dm) {
 
80
                                totvert = dm->getNumVerts(dm);
 
81
                                totedge = dm->getNumEdges(dm);
 
82
                                totface = dm->getNumPolys(dm);
 
83
 
 
84
                                stats->totvert += totvert * totob;
 
85
                                stats->totedge += totedge * totob;
 
86
                                stats->totface += totface * totob;
 
87
 
 
88
                                if (sel) {
 
89
                                        stats->totvertsel += totvert;
 
90
                                        stats->totfacesel += totface;
 
91
                                }
 
92
                        }
 
93
                        break;
 
94
                }
 
95
                case OB_LAMP:
 
96
                        stats->totlamp += totob;
 
97
                        break;
 
98
                case OB_SURF:
 
99
                case OB_CURVE:
 
100
                case OB_FONT: {
 
101
                        int tot = 0, totf = 0;
 
102
 
 
103
                        stats->totcurve += totob;
 
104
 
 
105
                        if (ob->disp.first)
 
106
                                count_displist(&ob->disp, &tot, &totf);
 
107
 
 
108
                        tot *= totob;
 
109
                        totf *= totob;
 
110
 
 
111
                        stats->totvert += tot;
 
112
                        stats->totface += totf;
 
113
 
 
114
                        if (sel) {
 
115
                                stats->totvertsel += tot;
 
116
                                stats->totfacesel += totf;
 
117
                        }
 
118
                        break;
 
119
                }
 
120
                case OB_MBALL: {
 
121
                        int tot = 0, totf = 0;
 
122
 
 
123
                        count_displist(&ob->disp, &tot, &totf);
 
124
 
 
125
                        tot *= totob;
 
126
                        totf *= totob;
 
127
 
 
128
                        stats->totvert += tot;
 
129
                        stats->totface += totf;
 
130
 
 
131
                        if (sel) {
 
132
                                stats->totvertsel += tot;
 
133
                                stats->totfacesel += totf;
 
134
                        }
 
135
                        break;
 
136
                }
131
137
        }
132
138
}
133
139
 
134
140
static void stats_object_edit(Object *obedit, SceneStats *stats)
135
141
{
136
 
        if(obedit->type==OB_MESH) {
137
 
                /* Mesh Edit */
138
 
                EditMesh *em= BKE_mesh_get_editmesh(obedit->data);
139
 
                EditVert *eve;
140
 
                EditEdge *eed;
141
 
                EditFace *efa;
142
 
                
143
 
                for(eve= em->verts.first; eve; eve=eve->next) {
144
 
                        stats->totvert++;
145
 
                        if(eve->f & SELECT) stats->totvertsel++;
146
 
                }
147
 
                for(eed= em->edges.first; eed; eed=eed->next) {
148
 
                        stats->totedge++;
149
 
                        if(eed->f & SELECT) stats->totedgesel++;
150
 
                }
151
 
                for(efa= em->faces.first; efa; efa=efa->next) {
152
 
                        stats->totface++;
153
 
                        if(efa->f & SELECT) stats->totfacesel++;
154
 
                }
155
 
                
156
 
                EM_validate_selections(em);
 
142
        if (obedit->type == OB_MESH) {
 
143
                BMEditMesh *em = BMEdit_FromObject(obedit);
 
144
 
 
145
                stats->totvert = em->bm->totvert;
 
146
                stats->totvertsel = em->bm->totvertsel;
 
147
                
 
148
                stats->totedge = em->bm->totedge;
 
149
                stats->totedgesel = em->bm->totedgesel;
 
150
                
 
151
                stats->totface = em->bm->totface;
 
152
                stats->totfacesel = em->bm->totfacesel;
157
153
        }
158
 
        else if(obedit->type==OB_ARMATURE){
 
154
        else if (obedit->type == OB_ARMATURE) {
159
155
                /* Armature Edit */
160
 
                bArmature *arm= obedit->data;
 
156
                bArmature *arm = obedit->data;
161
157
                EditBone *ebo;
162
158
 
163
 
                for(ebo=arm->edbo->first; ebo; ebo=ebo->next){
 
159
                for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
164
160
                        stats->totbone++;
165
161
                        
166
 
                        if((ebo->flag & BONE_CONNECTED) && ebo->parent)
 
162
                        if ((ebo->flag & BONE_CONNECTED) && ebo->parent)
167
163
                                stats->totvert--;
168
164
                        
169
 
                        if(ebo->flag & BONE_TIPSEL)
 
165
                        if (ebo->flag & BONE_TIPSEL)
170
166
                                stats->totvertsel++;
171
 
                        if(ebo->flag & BONE_ROOTSEL)
 
167
                        if (ebo->flag & BONE_ROOTSEL)
172
168
                                stats->totvertsel++;
173
169
                        
174
 
                        if(ebo->flag & BONE_SELECTED) stats->totbonesel++;
 
170
                        if (ebo->flag & BONE_SELECTED) stats->totbonesel++;
175
171
 
176
172
                        /* if this is a connected child and it's parent is being moved, remove our root */
177
 
                        if((ebo->flag & BONE_CONNECTED)&& (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
 
173
                        if ((ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL))
178
174
                                stats->totvertsel--;
179
175
 
180
 
                        stats->totvert+=2;
 
176
                        stats->totvert += 2;
181
177
                }
182
178
        }
183
 
        else if ELEM(obedit->type, OB_CURVE, OB_SURF) { /* OB_FONT has no cu->editnurb */
 
179
        else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { /* OB_FONT has no cu->editnurb */
184
180
                /* Curve Edit */
185
 
                Curve *cu= obedit->data;
 
181
                Curve *cu = obedit->data;
186
182
                Nurb *nu;
187
183
                BezTriple *bezt;
188
184
                BPoint *bp;
189
185
                int a;
 
186
                ListBase *nurbs = curve_editnurbs(cu);
190
187
 
191
 
                for(nu=cu->editnurb->first; nu; nu=nu->next) {
192
 
                        if(nu->type == CU_BEZIER) {
193
 
                                bezt= nu->bezt;
194
 
                                a= nu->pntsu;
195
 
                                while(a--) {
196
 
                                        stats->totvert+=3;
197
 
                                        if(bezt->f1) stats->totvertsel++;
198
 
                                        if(bezt->f2) stats->totvertsel++;
199
 
                                        if(bezt->f3) stats->totvertsel++;
 
188
                for (nu = nurbs->first; nu; nu = nu->next) {
 
189
                        if (nu->type == CU_BEZIER) {
 
190
                                bezt = nu->bezt;
 
191
                                a = nu->pntsu;
 
192
                                while (a--) {
 
193
                                        stats->totvert += 3;
 
194
                                        if (bezt->f1) stats->totvertsel++;
 
195
                                        if (bezt->f2) stats->totvertsel++;
 
196
                                        if (bezt->f3) stats->totvertsel++;
200
197
                                        bezt++;
201
198
                                }
202
199
                        }
203
200
                        else {
204
 
                                bp= nu->bp;
205
 
                                a= nu->pntsu*nu->pntsv;
206
 
                                while(a--) {
 
201
                                bp = nu->bp;
 
202
                                a = nu->pntsu * nu->pntsv;
 
203
                                while (a--) {
207
204
                                        stats->totvert++;
208
 
                                        if(bp->f1 & SELECT) stats->totvertsel++;
 
205
                                        if (bp->f1 & SELECT) stats->totvertsel++;
209
206
                                        bp++;
210
207
                                }
211
208
                        }
212
209
                }
213
210
        }
214
 
        else if(obedit->type==OB_MBALL) {
 
211
        else if (obedit->type == OB_MBALL) {
215
212
                /* MetaBall Edit */
216
 
                MetaBall *mball= obedit->data;
 
213
                MetaBall *mball = obedit->data;
217
214
                MetaElem *ml;
218
215
                
219
 
                for(ml= mball->editelems->first; ml; ml=ml->next) {
 
216
                for (ml = mball->editelems->first; ml; ml = ml->next) {
220
217
                        stats->totvert++;
221
 
                        if(ml->flag & SELECT) stats->totvertsel++;
 
218
                        if (ml->flag & SELECT) stats->totvertsel++;
222
219
                }
223
220
        }
224
 
        else if(obedit->type==OB_LATTICE) {
 
221
        else if (obedit->type == OB_LATTICE) {
225
222
                /* Lattice Edit */
226
 
                Lattice *lt= obedit->data;
227
 
                Lattice *editlatt= lt->editlatt;
 
223
                Lattice *lt = obedit->data;
 
224
                Lattice *editlatt = lt->editlatt->latt;
228
225
                BPoint *bp;
229
226
                int a;
230
227
 
231
 
                bp= editlatt->def;
 
228
                bp = editlatt->def;
232
229
                
233
 
                a= editlatt->pntsu*editlatt->pntsv*editlatt->pntsw;
234
 
                while(a--) {
 
230
                a = editlatt->pntsu * editlatt->pntsv * editlatt->pntsw;
 
231
                while (a--) {
235
232
                        stats->totvert++;
236
 
                        if(bp->f1 & SELECT) stats->totvertsel++;
 
233
                        if (bp->f1 & SELECT) stats->totvertsel++;
237
234
                        bp++;
238
235
                }
239
236
        }
241
238
 
242
239
static void stats_object_pose(Object *ob, SceneStats *stats)
243
240
{
244
 
        if(ob->pose) {
245
 
                bArmature *arm= ob->data;
 
241
        if (ob->pose) {
 
242
                bArmature *arm = ob->data;
246
243
                bPoseChannel *pchan;
247
244
 
248
 
                for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
 
245
                for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
249
246
                        stats->totbone++;
250
 
                        if(pchan->bone && (pchan->bone->flag & BONE_SELECTED))
251
 
                                if(pchan->bone->layer & arm->layer)
 
247
                        if (pchan->bone && (pchan->bone->flag & BONE_SELECTED))
 
248
                                if (pchan->bone->layer & arm->layer)
252
249
                                        stats->totbonesel++;
253
250
                }
254
251
        }
255
252
}
256
253
 
257
 
static void stats_object_paint(Object *ob, SceneStats *stats)
258
 
{
259
 
        if(ob->type == OB_MESH) {
260
 
                Mesh *me= ob->data;
261
 
 
262
 
                stats->totface= me->totface;
263
 
                stats->totvert= me->totvert;
264
 
        }
265
 
}
266
 
 
267
254
static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
268
255
{
269
 
        if(base->flag & SELECT) stats->totobjsel++;
 
256
        if (base->flag & SELECT) stats->totobjsel++;
270
257
 
271
 
        if(ob->transflag & OB_DUPLIPARTS) {
 
258
        if (ob->transflag & OB_DUPLIPARTS) {
272
259
                /* Dupli Particles */
273
260
                ParticleSystem *psys;
274
261
                ParticleSettings *part;
275
262
 
276
 
                for(psys=ob->particlesystem.first; psys; psys=psys->next){
277
 
                        part=psys->part;
 
263
                for (psys = ob->particlesystem.first; psys; psys = psys->next) {
 
264
                        part = psys->part;
278
265
 
279
 
                        if(part->draw_as==PART_DRAW_OB && part->dup_ob){
280
 
                                int tot=count_particles(psys);
 
266
                        if (part->draw_as == PART_DRAW_OB && part->dup_ob) {
 
267
                                int tot = count_particles(psys);
281
268
                                stats_object(part->dup_ob, 0, tot, stats);
282
269
                        }
283
 
                        else if(part->draw_as==PART_DRAW_GR && part->dup_group){
 
270
                        else if (part->draw_as == PART_DRAW_GR && part->dup_group) {
284
271
                                GroupObject *go;
285
 
                                int tot, totgroup=0, cur=0;
 
272
                                int tot, totgroup = 0, cur = 0;
286
273
                                
287
 
                                for(go= part->dup_group->gobject.first; go; go=go->next)
 
274
                                for (go = part->dup_group->gobject.first; go; go = go->next)
288
275
                                        totgroup++;
289
276
 
290
 
                                for(go= part->dup_group->gobject.first; go; go=go->next) {
291
 
                                        tot=count_particles_mod(psys,totgroup,cur);
 
277
                                for (go = part->dup_group->gobject.first; go; go = go->next) {
 
278
                                        tot = count_particles_mod(psys, totgroup, cur);
292
279
                                        stats_object(go->ob, 0, tot, stats);
293
280
                                        cur++;
294
281
                                }
298
285
                stats_object(ob, base->flag & SELECT, 1, stats);
299
286
                stats->totobj++;
300
287
        }
301
 
        else if(ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS|OB_DUPLIFACES))) {
 
288
        else if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) {
302
289
                /* Dupli Verts/Faces */
303
 
                int tot= count_duplilist(ob->parent);
304
 
                stats->totobj+=tot;
 
290
                int tot = count_duplilist(ob->parent);
 
291
                stats->totobj += tot;
305
292
                stats_object(ob, base->flag & SELECT, tot, stats);
306
293
        }
307
 
        else if(ob->transflag & OB_DUPLIFRAMES) {
 
294
        else if (ob->transflag & OB_DUPLIFRAMES) {
308
295
                /* Dupli Frames */
309
 
                int tot= count_duplilist(ob);
310
 
                stats->totobj+=tot;
 
296
                int tot = count_duplilist(ob);
 
297
                stats->totobj += tot;
311
298
                stats_object(ob, base->flag & SELECT, tot, stats);
312
299
        }
313
 
        else if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
 
300
        else if ((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
314
301
                /* Dupli Group */
315
 
                int tot= count_duplilist(ob);
316
 
                stats->totobj+=tot;
 
302
                int tot = count_duplilist(ob);
 
303
                stats->totobj += tot;
317
304
                stats_object(ob, base->flag & SELECT, tot, stats);
318
305
        }
319
306
        else {
326
313
/* Statistics displayed in info header. Called regularly on scene changes. */
327
314
static void stats_update(Scene *scene)
328
315
{
329
 
        SceneStats stats;
330
 
        Object *ob= (scene->basact)? scene->basact->object: NULL;
 
316
        SceneStats stats = {0};
 
317
        Object *ob = (scene->basact) ? scene->basact->object : NULL;
331
318
        Base *base;
332
319
        
333
 
        memset(&stats, 0, sizeof(stats));
334
 
 
335
 
        if(scene->obedit) {
 
320
        if (scene->obedit) {
336
321
                /* Edit Mode */
337
322
                stats_object_edit(scene->obedit, &stats);
338
323
        }
339
 
        else if(ob && (ob->mode & OB_MODE_POSE)) {
 
324
        else if (ob && (ob->mode & OB_MODE_POSE)) {
340
325
                /* Pose Mode */
341
326
                stats_object_pose(ob, &stats);
342
327
        }
343
 
        else if(ob && (ob->flag & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) {
344
 
                /* Sculpt and Paint Mode */
345
 
                stats_object_paint(ob, &stats);
346
 
        }
347
328
        else {
348
329
                /* Objects */
349
 
                for(base= scene->base.first; base; base=base->next)
350
 
                        if(scene->lay & base->lay)
 
330
                for (base = scene->base.first; base; base = base->next)
 
331
                        if (scene->lay & base->lay)
351
332
                                stats_dupli_object(base, base->object, &stats);
352
333
        }
353
334
 
354
 
        if(!scene->stats)
355
 
                scene->stats= MEM_mallocN(sizeof(SceneStats), "SceneStats");
 
335
        if (!scene->stats)
 
336
                scene->stats = MEM_callocN(sizeof(SceneStats), "SceneStats");
356
337
 
357
 
        *(scene->stats)= stats;
 
338
        *(scene->stats) = stats;
358
339
}
359
340
 
360
341
static void stats_string(Scene *scene)
361
342
{
362
 
        SceneStats *stats= scene->stats;
363
 
        Object *ob= (scene->basact)? scene->basact->object: NULL;
 
343
        SceneStats *stats = scene->stats;
 
344
        Object *ob = (scene->basact) ? scene->basact->object : NULL;
364
345
        uintptr_t mem_in_use, mmap_in_use;
365
346
        char memstr[64];
366
347
        char *s;
367
348
 
368
 
        mem_in_use= MEM_get_memory_in_use();
369
 
        mmap_in_use= MEM_get_mapped_memory_in_use();
 
349
        mem_in_use = MEM_get_memory_in_use();
 
350
        mmap_in_use = MEM_get_mapped_memory_in_use();
370
351
 
371
352
        /* get memory statistics */
372
 
        s= memstr + sprintf(memstr, " | Mem:%.2fM", ((mem_in_use-mmap_in_use)>>10)/1024.0);
373
 
        if(mmap_in_use)
374
 
                sprintf(s, " (%.2fM)", ((mmap_in_use)>>10)/1024.0);
375
 
 
376
 
        s= stats->infostr;
377
 
 
378
 
        if(scene->obedit) {
379
 
                if(ob_get_keyblock(scene->obedit))
380
 
                        s+= sprintf(s, "(Key) ");
381
 
 
382
 
                if(scene->obedit->type==OB_MESH) {
383
 
                        if(scene->toolsettings->selectmode & SCE_SELECT_VERTEX)
384
 
                                s+= sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
385
 
                                                stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
386
 
                        else if(scene->toolsettings->selectmode & SCE_SELECT_EDGE)
387
 
                                s+= sprintf(s, "Ed:%d-%d | Fa:%d-%d",
388
 
                                                stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
 
353
        s = memstr + sprintf(memstr, " | Mem:%.2fM", (double)((mem_in_use - mmap_in_use) >> 10) / 1024.0);
 
354
        if (mmap_in_use)
 
355
                sprintf(s, " (%.2fM)", (double)((mmap_in_use) >> 10) / 1024.0);
 
356
 
 
357
        s = stats->infostr;
 
358
        
 
359
        s += sprintf(s, "%s | ", versionstr);
 
360
 
 
361
        if (scene->obedit) {
 
362
                if (ob_get_keyblock(scene->obedit))
 
363
                        s += sprintf(s, "(Key) ");
 
364
 
 
365
                if (scene->obedit->type == OB_MESH) {
 
366
                        if (scene->toolsettings->selectmode & SCE_SELECT_VERTEX)
 
367
                                s += sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d",
 
368
                                             stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
 
369
                        else if (scene->toolsettings->selectmode & SCE_SELECT_EDGE)
 
370
                                s += sprintf(s, "Ed:%d-%d | Fa:%d-%d",
 
371
                                             stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface);
389
372
                        else
390
 
                                s+= sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface);
 
373
                                s += sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface);
391
374
                }
392
 
                else if(scene->obedit->type==OB_ARMATURE) {
393
 
                        s+= sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
 
375
                else if (scene->obedit->type == OB_ARMATURE) {
 
376
                        s += sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone);
394
377
                }
395
378
                else {
396
 
                        s+= sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert);
 
379
                        s += sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert);
397
380
                }
398
381
 
399
382
                strcat(s, memstr);
400
383
        }
401
 
        else if(ob && (ob->mode & OB_MODE_POSE)) {
 
384
        else if (ob && (ob->mode & OB_MODE_POSE)) {
402
385
                s += sprintf(s, "Bo:%d-%d %s",
403
 
                                        stats->totbonesel, stats->totbone, memstr);
 
386
                             stats->totbonesel, stats->totbone, memstr);
404
387
        }
405
388
        else {
406
389
                s += sprintf(s, "Ve:%d | Fa:%d | Ob:%d-%d | La:%d%s",
407
 
                        stats->totvert, stats->totface, stats->totobjsel, stats->totobj, stats->totlamp, memstr);
 
390
                             stats->totvert, stats->totface, stats->totobjsel, stats->totobj, stats->totlamp, memstr);
408
391
        }
409
392
 
410
 
        if(ob)
411
 
                sprintf(s, " | %s", ob->id.name+2);
 
393
        if (ob)
 
394
                sprintf(s, " | %s", ob->id.name + 2);
412
395
}
413
396
 
414
397
void ED_info_stats_clear(Scene *scene)
415
398
{
416
 
        if(scene->stats) {
 
399
        if (scene->stats) {
417
400
                MEM_freeN(scene->stats);
418
 
                scene->stats= NULL;
 
401
                scene->stats = NULL;
419
402
        }
420
403
}
421
404
 
422
 
char *ED_info_stats_string(Scene *scene)
 
405
const char *ED_info_stats_string(Scene *scene)
423
406
{
424
 
        if(!scene->stats)
 
407
        if (!scene->stats)
425
408
                stats_update(scene);
426
409
        stats_string(scene);
427
410