Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2007-03-09 18:36:21 +0300
committerGeoffrey Bantle <hairbat@yahoo.com>2007-03-09 18:36:21 +0300
commit50186c9a2d1f677cfb5510706fc97cfb60dcefea (patch)
treef2486e93f30bbd42942a825a920e56754ba4253d /source/blender/src/edit.c
parent86a20402b62f46eb66a53a93a1943520fe16e842 (diff)
-> Small bug fix for modifiers and info header stats
Small but very annoying issue with modifiers meant that G.totvert/totedge/totface were updated to reflect the effects of a subsurf modifier in object mode but all other modifier types were ignored. This was not only inconsistent, but also made it very difficult to keep track of poly budgets. Now in order to obtain accurate counts object_handle_update is called immediatly after adding a modifier and precedes a call to countall() which has been modified to query the final derived mesh directly using dm->getNumVerts/Edges/Faces callbacks. Editmode behaviour is unchanged.
Diffstat (limited to 'source/blender/src/edit.c')
-rw-r--r--source/blender/src/edit.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c
index 08f72946187..9f73a9674b0 100644
--- a/source/blender/src/edit.c
+++ b/source/blender/src/edit.c
@@ -73,6 +73,7 @@
#include "BKE_anim.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
+#include "BKE_DerivedMesh.h"
#include "BKE_displist.h"
#include "BKE_global.h"
#include "BKE_ipo.h"
@@ -509,34 +510,29 @@ static void count_object(Object *ob, int sel, int totob)
{
Mesh *me;
Curve *cu;
+ DerivedMesh *dm;
int tot=0, totf=0, subsurf;
-
+
switch(ob->type) {
case OB_MESH:
- G.totmesh+=totob;
- me= get_mesh(ob);
- if(me) {
- ModifierData *md = modifiers_findByType(ob, eModifierType_Subsurf);
- int totvert, totface;
-
- subsurf= 1;
- if (md) {
- SubsurfModifierData *smd = (SubsurfModifierData*) md;
- if(smd->modifier.mode & eModifierMode_Realtime)
- subsurf= 1<<(2*smd->levels);
- }
-
- totvert= subsurf*me->totvert*totob;
- totface= subsurf*me->totface*totob;
-
- G.totvert+= totvert;
- G.totface+= totface;
- if(sel) {
- G.totvertsel+= totvert;
- G.totfacesel+= totface;
+ G.totmesh+=totob;
+ me= get_mesh(ob);
+ if(me) {
+ int totvert, totedge, totface;
+ dm = mesh_get_derived_final(ob, get_viewedit_datamask());
+ totvert = dm->getNumVerts(dm);
+ totedge = dm->getNumEdges(dm);
+ totface = dm->getNumFaces(dm);
+
+ G.totvert+= totvert*totob;
+ G.totedge+= totedge*totob;
+ G.totface+= totface*totob;
+ if(sel) {
+ G.totvertsel+= totvert;
+ G.totfacesel+= totface;
+ }
}
- }
- break;
+ break;
case OB_LAMP:
G.totlamp+=totob;