Refactor: Move lattice foreach_id to new IDTypeInfo structure.
This commit is contained in:
parent
b1b93c2ef1
commit
70b73732fe
|
@ -52,6 +52,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_modifier.h"
|
||||
#include "BKE_object.h"
|
||||
|
@ -121,6 +122,12 @@ static void lattice_free_data(ID *id)
|
|||
}
|
||||
}
|
||||
|
||||
static void lattice_foreach_id(ID *id, LibraryForeachIDData *data)
|
||||
{
|
||||
Lattice *lattice = (Lattice *)id;
|
||||
BKE_LIB_FOREACHID_PROCESS(data, lattice->key, IDWALK_CB_USER);
|
||||
}
|
||||
|
||||
IDTypeInfo IDType_ID_LT = {
|
||||
.id_code = ID_LT,
|
||||
.id_filter = FILTER_ID_LT,
|
||||
|
@ -135,6 +142,7 @@ IDTypeInfo IDType_ID_LT = {
|
|||
.copy_data = lattice_copy_data,
|
||||
.free_data = lattice_free_data,
|
||||
.make_local = NULL,
|
||||
.foreach_id = lattice_foreach_id,
|
||||
};
|
||||
|
||||
int BKE_lattice_index_from_uvw(Lattice *lt, const int u, const int v, const int w)
|
||||
|
|
|
@ -942,8 +942,7 @@ static void library_foreach_ID_link(Main *bmain,
|
|||
}
|
||||
|
||||
case ID_LT: {
|
||||
Lattice *lattice = (Lattice *)id;
|
||||
CALLBACK_INVOKE(lattice->key, IDWALK_CB_USER);
|
||||
BLI_assert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue