diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-02 17:11:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-02 18:09:44 +0300 |
commit | 6560a962322f7c785b57adb1f259b8907f5d12f1 (patch) | |
tree | 041577dbd417d8d3f26b678aa3e2d7e556a72128 /source | |
parent | b6aa8a71fd8b12306ced2281805d70a24a6fc288 (diff) |
Depsgraph: Show log message when tagging specific depsgraph ID
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 7c49cb5100d..15993a0a35c 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -406,8 +406,49 @@ void deg_graph_id_tag_update_single_flag(Main *bmain, } +string stringify_append_bit(const string& str, eDepsgraph_Tag tag) +{ + string result = str; + if (!result.empty()) { + result += ", "; + } + result += DEG_update_tag_as_string(tag); + return result; +} + +string stringify_update_bitfield(int flag) +{ + if (flag == 0) { + return "LEGACY_0"; + } + string result = ""; + int current_flag = flag; + /* Special cases to avoid ALL flags form being split into + * individual bits. + */ + if ((current_flag & DEG_TAG_PSYS_ALL) == DEG_TAG_PSYS_ALL) { + result = stringify_append_bit(result, DEG_TAG_PSYS_ALL); + } + /* Handle all the rest of the flags. */ + while (current_flag != 0) { + eDepsgraph_Tag tag = + (eDepsgraph_Tag)(1 << bitscan_forward_clear_i(¤t_flag)); + result = stringify_append_bit(result, tag); + } + return result; +} + void deg_graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, int flag) { + const int debug_flags = (graph != NULL) + ? DEG_debug_flags_get((::Depsgraph *)graph) + : G.debug; + if (debug_flags & G_DEBUG_DEPSGRAPH_TAG) { + printf("%s: id=%s flags=%s\n", + __func__, + id->name, + stringify_update_bitfield(flag).c_str()); + } IDDepsNode *id_node = (graph != NULL) ? graph->find_id_node(id) : NULL; DEG_id_type_tag(bmain, GS(id->name)); @@ -482,38 +523,6 @@ void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph) } } -string stringify_append_bit(const string& str, eDepsgraph_Tag tag) -{ - string result = str; - if (!result.empty()) { - result += ", "; - } - result += DEG_update_tag_as_string(tag); - return result; -} - -string stringify_update_bitfield(int flag) -{ - if (flag == 0) { - return "LEGACY_0"; - } - string result = ""; - int current_flag = flag; - /* Special cases to avoid ALL flags form being split into - * individual bits. - */ - if ((current_flag & DEG_TAG_PSYS_ALL) == DEG_TAG_PSYS_ALL) { - result = stringify_append_bit(result, DEG_TAG_PSYS_ALL); - } - /* Handle all the rest of the flags. */ - while (current_flag != 0) { - eDepsgraph_Tag tag = - (eDepsgraph_Tag)(1 << bitscan_forward_clear_i(¤t_flag)); - result = stringify_append_bit(result, tag); - } - return result; -} - } /* namespace */ } // namespace DEG @@ -554,12 +563,6 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, int flag) /* Ideally should not happen, but old depsgraph allowed this. */ return; } - if (G.debug & G_DEBUG_DEPSGRAPH_TAG) { - printf("%s: id=%s flags=%s\n", - __func__, - id->name, - DEG::stringify_update_bitfield(flag).c_str()); - } DEG::deg_id_tag_update(bmain, id, flag); } |