Cleanup old special cases from some libquery callbacks.

We now have proper flagging for horrible loopback pointers...
This commit is contained in:
2020-02-13 14:26:27 +01:00
parent f28bb6992f
commit a1397e48b9
2 changed files with 7 additions and 9 deletions

View File

@@ -7758,6 +7758,9 @@ static int lib_link_main_data_restore_cb(LibraryIDLinkCallbackData *cb_data)
if (GS((*id_pointer)->name) == ID_GR) { if (GS((*id_pointer)->name) == ID_GR) {
Collection *collection = (Collection *)*id_pointer; Collection *collection = (Collection *)*id_pointer;
if (collection->flag & COLLECTION_IS_MASTER) { if (collection->flag & COLLECTION_IS_MASTER) {
/* We should never reach that point anymore, since master collection private ID should be
* properly tagged with IDWALK_CB_PRIVATE. */
BLI_assert(0);
return IDWALK_RET_NOP; return IDWALK_RET_NOP;
} }
} }

View File

@@ -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) 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; ID **id_p = cb_data->id_pointer;
if (*id_p) { if (*id_p) {
IDUserMapData *data = cb_data->user_data;
const int cb_flag = cb_data->cb_flag;
if (data->types_bitmap) { if (data->types_bitmap) {
if (!id_check_type(*id_p, 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)) { if (cb_flag & IDWALK_CB_LOOPBACK) {
/* We skip proxy_from here, /* 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;
}
else if ((GS(self_id->name) == ID_KE) && (id_p == (ID **)&((Key *)self_id)->from)) {
/* We skip from here,
* since it's some internal pointer which is not relevant info for py/API level. */ * since it's some internal pointer which is not relevant info for py/API level. */
return IDWALK_RET_NOP; return IDWALK_RET_NOP;
} }