Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-05-12 18:57:17 +0300
committerBastien Montagne <bastien@blender.org>2020-05-12 19:54:57 +0300
commitef6610dec599ac1788745206bd1b3055d26ae128 (patch)
tree3ba24c2baf764663b6005bf4d965acaa40c9613f /source/blender
parent1606e732c2d18ceda9e3d021062df7429eed0692 (diff)
Refactor: Move Curve foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/curve.c18
-rw-r--r--source/blender/blenkernel/intern/lib_query.c13
2 files changed, 19 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 76dec63903b..72197869f58 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -52,6 +52,7 @@
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_object.h"
@@ -117,6 +118,22 @@ static void curve_free_data(ID *id)
MEM_SAFE_FREE(curve->tb);
}
+static void curve_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ Curve *curve = (Curve *)id;
+ BKE_LIB_FOREACHID_PROCESS(data, curve->bevobj, IDWALK_CB_NOP);
+ BKE_LIB_FOREACHID_PROCESS(data, curve->taperobj, IDWALK_CB_NOP);
+ BKE_LIB_FOREACHID_PROCESS(data, curve->textoncurve, IDWALK_CB_NOP);
+ BKE_LIB_FOREACHID_PROCESS(data, curve->key, IDWALK_CB_USER);
+ for (int i = 0; i < curve->totcol; i++) {
+ BKE_LIB_FOREACHID_PROCESS(data, curve->mat[i], IDWALK_CB_USER);
+ }
+ BKE_LIB_FOREACHID_PROCESS(data, curve->vfont, IDWALK_CB_USER);
+ BKE_LIB_FOREACHID_PROCESS(data, curve->vfontb, IDWALK_CB_USER);
+ BKE_LIB_FOREACHID_PROCESS(data, curve->vfonti, IDWALK_CB_USER);
+ BKE_LIB_FOREACHID_PROCESS(data, curve->vfontbi, IDWALK_CB_USER);
+}
+
IDTypeInfo IDType_ID_CU = {
.id_code = ID_CU,
.id_filter = FILTER_ID_CU,
@@ -131,6 +148,7 @@ IDTypeInfo IDType_ID_CU = {
.copy_data = curve_copy_data,
.free_data = curve_free_data,
.make_local = NULL,
+ .foreach_id = curve_foreach_id,
};
static int cu_isectLL(const float v1[3],
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index 0acd4c39ca4..c87af1e8bdd 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -917,18 +917,7 @@ static void library_foreach_ID_link(Main *bmain,
}
case ID_CU: {
- Curve *curve = (Curve *)id;
- CALLBACK_INVOKE(curve->bevobj, IDWALK_CB_NOP);
- CALLBACK_INVOKE(curve->taperobj, IDWALK_CB_NOP);
- CALLBACK_INVOKE(curve->textoncurve, IDWALK_CB_NOP);
- CALLBACK_INVOKE(curve->key, IDWALK_CB_USER);
- for (i = 0; i < curve->totcol; i++) {
- CALLBACK_INVOKE(curve->mat[i], IDWALK_CB_USER);
- }
- CALLBACK_INVOKE(curve->vfont, IDWALK_CB_USER);
- CALLBACK_INVOKE(curve->vfontb, IDWALK_CB_USER);
- CALLBACK_INVOKE(curve->vfonti, IDWALK_CB_USER);
- CALLBACK_INVOKE(curve->vfontbi, IDWALK_CB_USER);
+ BLI_assert(0);
break;
}