Fix Py's IDs user mapping: do not consider ShapeKeys' from here.

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
This commit is contained in:
Bastien Montagne 2016-09-15 11:12:31 +02:00 committed by Sergey Sharybin
parent ca5f91951c
commit 4733544195
1 changed files with 6 additions and 0 deletions

View 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,