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 16:26:27 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-13 18:23:42 +0300
commita1397e48b9529fe97c8801a07d0ce3daa3594f95 (patch)
treee9140f90691d00c1233be38c5714714f02f4f904 /source/blender/python
parentf28bb6992fa9773fb1e7918d569f4c88427f4c96 (diff)
Cleanup old special cases from some libquery callbacks.
We now have proper flagging for horrible loopback pointers...
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_rna_id_collection.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c
index 6084f3f3ad9..ce47f5e4f65 100644
--- a/source/blender/python/intern/bpy_rna_id_collection.c
+++ b/source/blender/python/intern/bpy_rna_id_collection.c
@@ -84,11 +84,11 @@ static bool id_check_type(const ID *id, const BLI_bitmap *types_bitmap)
static int foreach_libblock_id_user_map_callback(LibraryIDLinkCallbackData *cb_data)
{
- IDUserMapData *data = cb_data->user_data;
- ID *self_id = cb_data->id_self;
ID **id_p = cb_data->id_pointer;
if (*id_p) {
+ IDUserMapData *data = cb_data->user_data;
+ const int cb_flag = cb_data->cb_flag;
if (data->types_bitmap) {
if (!id_check_type(*id_p, data->types_bitmap)) {
@@ -96,13 +96,8 @@ static int foreach_libblock_id_user_map_callback(LibraryIDLinkCallbackData *cb_d
}
}
- if ((GS(self_id->name) == ID_OB) && (id_p == (ID **)&((Object *)self_id)->proxy_from)) {
- /* We skip proxy_from here,
- * since it's some internal pointer which is not relevant info for py/API level. */
- return IDWALK_RET_NOP;
- }
- else if ((GS(self_id->name) == ID_KE) && (id_p == (ID **)&((Key *)self_id)->from)) {
- /* We skip from here,
+ if (cb_flag & IDWALK_CB_LOOPBACK) {
+ /* We skip loopback pointers like Object.proxy_from or Key.from here,
* since it's some internal pointer which is not relevant info for py/API level. */
return IDWALK_RET_NOP;
}