forked from bartvdbraak/blender
bmesh: corrected fix for svulpting on non-multires mesh
Previous fix wasn't correct. It made things working, but it removed advantage of using PBVH for speed because derivedMesh used to be recreated on each stroke step. This commit fixes non-multires sculpting for Solid shading, wireframe and render wouldn't work correct -- it'll require a bit more tricky things because DM created for base mesh doesn't points to mesh->mverts anymore, so sculpting and drawing modules are using different verts arrays.
This commit is contained in:
parent
05bde0b0f0
commit
3b891aea5c
@ -239,7 +239,7 @@ static int can_pbvh_draw(Object *ob, DerivedMesh *dm)
|
||||
if(deformed)
|
||||
return 0;
|
||||
|
||||
return (cddm->mvert == me->mvert) || ob->sculpt->kb;
|
||||
return dm->deformedOnly || ob->sculpt->kb;
|
||||
}
|
||||
|
||||
static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
|
||||
|
@ -3382,18 +3382,13 @@ static void sculpt_flush_update(bContext *C)
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
MultiresModifierData *mmd = ss->multires;
|
||||
|
||||
if (!ss->cache) {
|
||||
if(mmd)
|
||||
multires_mark_as_modified(ob);
|
||||
}
|
||||
|
||||
if(mmd)
|
||||
multires_mark_as_modified(ob);
|
||||
if(ob->derivedFinal) /* VBO no longer valid */
|
||||
GPU_drawobject_free(ob->derivedFinal);
|
||||
|
||||
if (!ss->cache || !mmd)
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
|
||||
if(ss->modifiers_active) {
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
ED_region_tag_redraw(ar);
|
||||
}
|
||||
else {
|
||||
|
@ -193,7 +193,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb)
|
||||
if((mmd=sculpt_multires_active(scene, ob)))
|
||||
multires_mark_as_modified(ob);
|
||||
|
||||
tag_update= ((Mesh*)ob->data)->id.us > 1 || !mmd;
|
||||
tag_update= ((Mesh*)ob->data)->id.us > 1;
|
||||
|
||||
if(ss->modifiers_active) {
|
||||
Mesh *mesh= ob->data;
|
||||
|
Loading…
Reference in New Issue
Block a user