diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-05-30 18:05:24 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-05-30 18:05:24 +0400 |
commit | a6689154047b4a838276170f48bd39372149af71 (patch) | |
tree | 7d9586cce02ab60585a43186ebb24157f5cf6455 /source | |
parent | c8b88dde8894944df90cef12d9825bd119314629 (diff) |
Fix #22446: "Delayed" modifier preview with linked curves
Since curve objects could have constructive modifiers, we can't
always avoid setting OB_RECALC_DATA to linked objects (displist
recalculation wouldn't enough for curves with such modifiers)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 0568050950f..bdeacdf6946 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2286,11 +2286,7 @@ void DAG_id_flush_update(ID *id, short flag) /* no point in trying in this cases */ if(!id || id->us <= 1) id= NULL; - /* curves and surfaces only need to mark one object, since - otherwise cu->displist would be computed multiple times */ - else if(ob->type==OB_CURVE || ob->type==OB_SURF) - id= NULL; - /* also for locked shape keys we make an exception */ + /* for locked shape keys we make an exception */ else if(ob_get_key(ob) && (ob->shapeflag & OB_SHAPE_LOCK)) id= NULL; } @@ -2301,15 +2297,23 @@ void DAG_id_flush_update(ID *id, short flag) idtype= GS(id->name); if(ELEM7(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR)) { + int first_ob= 1; for(obt=bmain->object.first; obt; obt= obt->id.next) { if(!(ob && obt == ob) && obt->data == id) { + + /* try to avoid displist recalculation for linked curves */ + if (!first_ob && ELEM(obt->type, OB_CURVE, OB_SURF)) { + /* if curve object has got derivedFinal it means this + object has got constructive modifiers and object + should be recalculated anyhow */ + if (!obt->derivedFinal) + continue; + } + obt->recalc |= OB_RECALC_DATA; BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); - /* for these we only flag one object, otherwise cu->displist - would be computed multiple times */ - if(obt->type==OB_CURVE || obt->type==OB_SURF) - break; + first_ob= 0; } } } |