diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-28 11:49:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-28 11:51:54 +0300 |
commit | f777983d5bf18daebb3f9940061f22a9641da759 (patch) | |
tree | 7c8613d078deda6e575b9a0f628cc8d84ec666bb /source/blender/depsgraph | |
parent | d9b67685210275a71bd22b4f8c35590bf795eb47 (diff) |
Add missing particle system tagging on update to the new depsgraph
It's not ideal and mimics weak legacy code, but so close to bcon4 we'd better
not start re-considering the way how particle works..
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 65109ff94dd..4736de513e5 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -62,6 +62,14 @@ extern "C" { /* *********************** */ /* Update Tagging/Flushing */ +/* Legacy depsgraph did some special trickery for things like particle systems + * when tagging ID for an update. Ideally that tagging needs to become obsolete + * in favor of havng dedicated node for that which gets tagged, but for until + * design of those areas is more clear we'll do the same legacy code here. + * - sergey - + */ +#define DEPSGRAPH_USE_LEGACY_TAGGING + /* Data-Based Tagging ------------------------------- */ static void lib_id_recalc_tag(Main *bmain, ID *id) @@ -108,6 +116,33 @@ static void lib_id_recalc_tag_flag(Main *bmain, ID *id, int flag) } } +#ifdef DEPSGRAPH_USE_LEGACY_TAGGING +static void depsgraph_legacy_handle_update_tag(Main *bmain, ID *id, short flag) +{ + if (flag) { + Object *object; + short idtype = GS(id->name); + if (idtype == ID_PA) { + ParticleSystem *psys; + for (object = (Object *)bmain->object.first; + object != NULL; + object = (Object *)object->id.next) + { + for (psys = (ParticleSystem *)object->particlesystem.first; + psys != NULL; + psys = (ParticleSystem *)psys->next) + { + if (&psys->part->id == id) { + DEG_id_tag_update_ex(bmain, &object->id, flag & OB_RECALC_ALL); + psys->recalc |= (flag & PSYS_RECALC); + } + } + } + } + } +} +#endif + /* Tag all nodes in ID-block for update. * This is a crude measure, but is most convenient for old code. */ @@ -189,6 +224,14 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, short flag) } } } + +#ifdef DEPSGRAPH_USE_LEGACY_TAGGING + /* Special handling from the legacy depsgraph. + * TODO(sergey): Need to get rid of those once all the areas + * are re-formulated in terms of franular nodes. + */ + depsgraph_legacy_handle_update_tag(bmain, id, flag); +#endif } /* Tag given ID type for update. */ |