[Bf-blender-cvs] [70b73732fe9] master: Refactor: Move lattice foreach_id to new IDTypeInfo structure.

Bastien Montagne noreply at git.blender.org
Tue May 12 19:02:50 CEST 2020


Commit: 70b73732fe9097b13495e75bea5bc0fb67b1bc4f
Author: Bastien Montagne
Date:   Tue May 12 18:11:53 2020 +0200
Branches: master
https://developer.blender.org/rB70b73732fe9097b13495e75bea5bc0fb67b1bc4f

Refactor: Move lattice foreach_id to new IDTypeInfo structure.

===================================================================

M	source/blender/blenkernel/intern/lattice.c
M	source/blender/blenkernel/intern/lib_query.c

===================================================================

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;
       }



More information about the Bf-blender-cvs mailing list