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 <montagne29@wanadoo.fr>2016-09-15 11:11:47 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-09-15 11:16:54 +0300
commite007552442634ea3b016f8552a4394b95272f58d (patch)
treedde726f0769dbdcd6663f4ede40b7f95f5352cc3 /source/blender/python/intern/bpy_rna_id_collection.c
parentfe1342ab9b4b45357b47250985ce1b72cd0dd80f (diff)
Fix Py's IDs user mapping: do not consider proxy_from here.
This is internal pointer helper for scene evaluation and tools, it's not exposed to bpy API anyway, and can give false 'dependency cycles' in bpy.data.user_map() results. Found by sybren in his Splode work.
Diffstat (limited to 'source/blender/python/intern/bpy_rna_id_collection.c')
-rw-r--r--source/blender/python/intern/bpy_rna_id_collection.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c
index 3e50e79c19e..95c2b3ac8f5 100644
--- a/source/blender/python/intern/bpy_rna_id_collection.c
+++ b/source/blender/python/intern/bpy_rna_id_collection.c
@@ -40,6 +40,7 @@
#include "BKE_library_query.h"
#include "DNA_ID.h"
+#include "DNA_object_types.h"
#include "bpy_util.h"
#include "bpy_rna_id_collection.h"
@@ -81,7 +82,7 @@ static bool id_check_type(const ID *id, const BLI_bitmap *types_bitmap)
}
static int foreach_libblock_id_user_map_callback(
- void *user_data, ID *UNUSED(self_id), ID **id_p, int UNUSED(cb_flag))
+ void *user_data, ID *self_id, ID **id_p, int UNUSED(cb_flag))
{
IDUserMapData *data = user_data;
@@ -93,6 +94,11 @@ static int foreach_libblock_id_user_map_callback(
}
}
+ if ((GS(self_id->name) == ID_OB) && (id_p == (ID **)&((Object *)self_id)->proxy_from)) {
+ /* We skip proxy_from here, since it some internal pointer which is not irrelevant info for py/API level. */
+ return IDWALK_RET_NOP;
+ }
+
/* pyrna_struct_hash() uses ptr.data only,
* but pyrna_struct_richcmp() uses also ptr.type,
* so we need to create a valid PointerRNA here...