diff options
author | Bastien Montagne <bastien@blender.org> | 2020-05-12 19:11:53 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-05-12 19:54:57 +0300 |
commit | 70b73732fe9097b13495e75bea5bc0fb67b1bc4f (patch) | |
tree | c441d871cb996640fd0b2a94755698808d86d2cc /source/blender/blenkernel | |
parent | b1b93c2ef19528b1ab6b564c5b97e1c0f05393cb (diff) |
Refactor: Move lattice foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_query.c | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index cc130559b45..e7a2421a625 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -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) diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index 3859c88bba1..754a1831edd 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -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; } |