Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-02-13 18:23:23 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-13 18:23:42 +0300
commitbe40d86e35b1a6387a60843aabe9b08cf7011806 (patch)
treee8097a55343286c2d04b4631b5aea0ffc7f9099c /source/blender/python
parent3ec3c5b557ded1e85b3952df242b138f5a8a634b (diff)
Fix (unreported) private/embedded IDs being added to `bpy.data.user_map()` dict.
We do not want those here.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_rna_id_collection.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c
index a711d223cdf..e1d5c358ba5 100644
--- a/source/blender/python/intern/bpy_rna_id_collection.c
+++ b/source/blender/python/intern/bpy_rna_id_collection.c
@@ -98,6 +98,12 @@ static int foreach_libblock_id_user_map_callback(LibraryIDLinkCallbackData *cb_d
return IDWALK_RET_NOP;
}
+ if (cb_flag & IDWALK_CB_PRIVATE) {
+ /* We skip private pointers themselves, like root node trees, we'll 'link' their own ID
+ * pointers to their 'ID owner' instead. */
+ return IDWALK_RET_NOP;
+ }
+
PyObject *key = pyrna_id_CreatePyObject(*id_p);
PyObject *set;