From 0762a5a975335b2e805c62934ba2b224edde119d Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 4 Jan 2007 06:11:45 +0000 Subject: [PATCH] Fixed bug #5582, Subsurfed Multires'd objects don't display properly with interactive display unset. Added a new function for sculptmode that checks to make sure that not only are there some modifiers active, but that they are actually enabled for realtime editing. --- source/blender/include/BDR_sculptmode.h | 1 + source/blender/src/drawobject.c | 2 +- source/blender/src/sculptmode.c | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/source/blender/include/BDR_sculptmode.h b/source/blender/include/BDR_sculptmode.h index bcf3b969715..79df879e7ef 100644 --- a/source/blender/include/BDR_sculptmode.h +++ b/source/blender/include/BDR_sculptmode.h @@ -127,6 +127,7 @@ struct BrushData *sculptmode_brush(); float *get_tex_angle(); void sculptmode_update_tex(); +char sculpt_modifiers_active(struct Object *ob); void sculpt(); void set_sculpt_object(struct Object *ob); void set_sculptmode(); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 0266e5fb002..5d8c959714f 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2163,7 +2163,7 @@ static int draw_mesh_object(Base *base, int dt, int flag) finalDM->release(finalDM); } else if(!G.obedit && G.scene->sculptdata.draw_mode && - OBACT==ob && !modifiers_getVirtualModifierList(ob)) { + OBACT==ob && !sculpt_modifiers_active(ob)) { sculptmode_draw_mesh(0); } else { diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index 8903b2386c2..5ac55cedbe1 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -493,8 +493,8 @@ void sculptmode_undo_update(SculptUndoStep *newcur) set_sculpt_object(ob); - if(!sculpt_data()->draw_mode || modifiers_getVirtualModifierList(ob)) - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); + if(!sculpt_data()->draw_mode || sculpt_modifiers_active(ob)) + DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); if(G.vd->depths) G.vd->depths->damaged= 1; allqueue(REDRAWVIEW3D, 0); @@ -1796,6 +1796,19 @@ void sculptmode_correct_state() if(!sculpt_session()->undo) sculptmode_undo_init(); } +/* Checks whether full update mode (slower) needs to be used to work with modifiers */ +char sculpt_modifiers_active(Object *ob) +{ + ModifierData *md; + + for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) { + if(md->mode & eModifierMode_Realtime) + return 1; + } + + return 0; +} + void sculpt() { SculptData *sd= sculpt_data(); @@ -1856,7 +1869,7 @@ void sculpt() /* If modifier_calculations is true, then extra time must be spent updating the mesh. This takes a *lot* longer, so it's worth skipping if the modifier stack is empty. */ - modifier_calculations= modifiers_getVirtualModifierList(ob) != NULL; + modifier_calculations= sculpt_modifiers_active(ob); init_sculptmatrices();