Fix Py's IDs user mapping: do not consider ShapeKeys' from here.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 15 Sep 2016 09:12:31 +0000 (11:12 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 22 Sep 2016 09:07:35 +0000 (11:07 +0200)
This is internal pointer helper for scene evaluation and tools, though exposed to bpy API,
it can give false 'dependency cycles' in bpy.data.user_map() results.

That's followup to rBe007552442634 really, both should be backported to 2.78

source/blender/python/intern/bpy_rna_id_collection.c

index 95c2b3a..1037c83 100644 (file)
@@ -40,7 +40,9 @@
 #include "BKE_library_query.h"
 
 #include "DNA_ID.h"
+/* Those folowing are only to support hack of not listing some internal 'backward' pointers in generated user_map... */
 #include "DNA_object_types.h"
+#include "DNA_key_types.h"
 
 #include "bpy_util.h"
 #include "bpy_rna_id_collection.h"
@@ -98,6 +100,10 @@ static int foreach_libblock_id_user_map_callback(
                        /* We skip proxy_from here, since it some internal pointer which is not irrelevant 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, 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,