diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 1ca495d8903..c5fdb564884 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -878,8 +878,9 @@ void do_modifier_panels(unsigned short event) allqueue(REDRAWVIEW3D, 0); allqueue(REDRAWIMAGE, 0); allqueue(REDRAWOOPS, 0); - countall(); DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); + object_handle_update(ob); + countall(); break; } } @@ -900,7 +901,6 @@ static void modifiers_add(void *ob_v, int type) } else { BLI_addtail(&ob->modifiers, modifier_new(type)); } - BIF_undo_push("Add modifier"); } 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); + 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; + } } - - totvert= subsurf*me->totvert*totob; - totface= subsurf*me->totface*totob; - - G.totvert+= totvert; - G.totface+= totface; - if(sel) { - G.totvertsel+= totvert; - G.totfacesel+= totface; - } - } - break; + break; case OB_LAMP: G.totlamp+=totob;