diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-11 19:25:31 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-11 19:26:58 +0300 |
commit | a54e17e52dc1202df99951c9873fa9211b2ee07b (patch) | |
tree | 928364c6e6742d7ff4946914199e1ad432a58e38 /source | |
parent | 7dd0be9554ae7a728ded1a95d4709a93b68301b4 (diff) |
LibQuery: Add option to NOT process embedded IDs.
Request from depsgraph department, which does basically consider those
embedded IDs as any other data-block (unlike any BKE ID management code).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_lib_query.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_query.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_lib_query.h b/source/blender/blenkernel/BKE_lib_query.h index 5b4aa019441..845351f22fa 100644 --- a/source/blender/blenkernel/BKE_lib_query.h +++ b/source/blender/blenkernel/BKE_lib_query.h @@ -116,6 +116,8 @@ enum { IDWALK_READONLY = (1 << 0), IDWALK_RECURSE = (1 << 1), /* Also implies IDWALK_READONLY. */ IDWALK_INCLUDE_UI = (1 << 2), /* Include UI pointers (from WM and screens editors). */ + /** Do not process ID pointers inside embedded IDs. Needed by depsgraph processing e.g. */ + IDWALK_IGNORE_EMBEDDED_ID = (1 << 3), IDWALK_NO_INDIRECT_PROXY_DATA_USAGE = (1 << 8), /* Ugly special case :(((( */ }; diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index b022cc1720b..41d938e897d 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -534,7 +534,10 @@ static void library_foreach_ID_as_subdata_link(ID **id_pp, FOREACH_CALLBACK_INVOKE_ID_PP(data, id_pp, IDWALK_CB_EMBEDDED); BLI_assert(id == *id_pp); - if (flag & IDWALK_RECURSE) { + if (flag & IDWALK_IGNORE_EMBEDDED_ID) { + /* Do Nothing. */ + } + else if (flag & IDWALK_RECURSE) { /* Defer handling into main loop, recursively calling BKE_library_foreach_ID_link in * IDWALK_RECURSE case is troublesome, see T49553. */ /* XXX note that this breaks the 'owner id' thing now, we likely want to handle that |