bmesh: proper sculpting on non-multires object

Problem was caused by unneeded call of CDDM_calc_normals when
creating derived mesh for object which duplicated mvert array.

It shouldn't happen unless object has got shapekeys or deformation
modifiers on the top of stack.
This commit is contained in:
Sergey Sharybin 2011-09-07 12:47:23 +00:00
parent 3b891aea5c
commit 2936ca5d04
2 changed files with 9 additions and 3 deletions

@ -1354,16 +1354,22 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
} else if(dm) {
finaldm = dm;
} else {
int recalc_normals= 0;
finaldm = CDDM_from_mesh(me, ob);
if (build_shapekey_layers)
if(build_shapekey_layers) {
add_shapekey_layers(finaldm, me, ob);
recalc_normals= 1;
}
if(deformedVerts) {
CDDM_apply_vert_coords(finaldm, deformedVerts);
recalc_normals= 1;
}
CDDM_calc_normals(finaldm);
if(recalc_normals)
CDDM_calc_normals(finaldm);
if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))
add_weight_mcol_dm(ob, finaldm);

@ -239,7 +239,7 @@ static int can_pbvh_draw(Object *ob, DerivedMesh *dm)
if(deformed)
return 0;
return dm->deformedOnly || ob->sculpt->kb;
return cddm->mvert == me->mvert || ob->sculpt->kb;
}
static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)