diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-03 12:05:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-09-03 12:06:41 +0300 |
commit | 65db18fc56c3f64fad02a3d02cb10b49b13adccc (patch) | |
tree | 2ac4ca78216592fa3b82ac0d82d21a74e2dca177 /source | |
parent | abfb8b6963f4fcf02108e81f17b9de3fbef99dce (diff) |
Fix T68868: Assert in depsgraph debugging logs
Was happening when tagging for LEGACY_0 was used.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph.h | 2 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index fd12f90016b..7553eca9b64 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -108,6 +108,8 @@ void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph, const /* Update all dependency graphs when visible scenes/layers changes. */ void DEG_on_visible_update(struct Main *bmain, const bool do_time); +/* NOTE: Will return NULL if the flag is not known, allowing to gracefully handle situations + * when recalc flag has been removed. */ const char *DEG_update_tag_as_string(IDRecalcFlag flag); void DEG_id_tag_update(struct ID *id, int flag); diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index b73a3c08e10..72ef495f1d5 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -412,11 +412,15 @@ static void graph_id_tag_update_single_flag(Main *bmain, string stringify_append_bit(const string &str, IDRecalcFlag tag) { + const char *tag_name = DEG_update_tag_as_string(tag); + if (tag_name == NULL) { + return str; + } string result = str; if (!result.empty()) { result += ", "; } - result += DEG_update_tag_as_string(tag); + result += tag_name; return result; } @@ -717,8 +721,7 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag) case ID_RECALC_ALL: return "ALL"; } - BLI_assert(!"Unhandled update flag, should never happen!"); - return "UNKNOWN"; + return NULL; } /* Data-Based Tagging */ |