Refactor: Move shapekey foreach_id to new IDTypeInfo structure.

This commit is contained in:
Bastien Montagne 2020-05-13 19:08:54 +02:00
parent 9ac5413ac0
commit 73f38f8db0
2 changed files with 9 additions and 2 deletions

View File

@ -51,6 +51,7 @@
#include "BKE_key.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_scene.h"
@ -91,6 +92,12 @@ static void shapekey_free_data(ID *id)
}
}
static void shapekey_foreach_id(ID *id, LibraryForeachIDData *data)
{
Key *key = (Key *)id;
BKE_LIB_FOREACHID_PROCESS_ID(data, key->from, IDWALK_CB_LOOPBACK);
}
IDTypeInfo IDType_ID_KE = {
.id_code = ID_KE,
.id_filter = 0,
@ -105,6 +112,7 @@ IDTypeInfo IDType_ID_KE = {
.copy_data = shapekey_copy_data,
.free_data = shapekey_free_data,
.make_local = NULL,
.foreach_id = shapekey_foreach_id,
};
#define KEY_MODE_DUMMY 0 /* use where mode isn't checked for */

View File

@ -934,8 +934,7 @@ static void library_foreach_ID_link(Main *bmain,
}
case ID_KE: {
Key *key = (Key *)id;
CALLBACK_INVOKE_ID(key->from, IDWALK_CB_LOOPBACK);
BLI_assert(0);
break;
}