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 19:20:49 +0300
committerBastien Montagne <bastien@blender.org>2020-05-12 19:54:57 +0300
commit9996688b71678a0ea9e98027d6cc3ed4c308959d (patch)
tree858b850edf5bcb65f49d862becceb503113747d1
parent70b73732fe9097b13495e75bea5bc0fb67b1bc4f (diff)
Refactor: Move library foreach_id to new IDTypeInfo structure.
-rw-r--r--source/blender/blenkernel/intern/lib_query.c3
-rw-r--r--source/blender/blenkernel/intern/library.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index 754a1831edd..c2df1d4e7ac 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -676,8 +676,7 @@ static void library_foreach_ID_link(Main *bmain,
switch ((ID_Type)GS(id->name)) {
case ID_LI: {
- Library *lib = (Library *)id;
- CALLBACK_INVOKE(lib->parent, IDWALK_CB_NEVER_SELF);
+ BLI_assert(0);
break;
}
case ID_SCE: {
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index e3ed21aa536..64ffea22363 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -38,6 +38,7 @@
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_packedFile.h"
@@ -53,6 +54,12 @@ static void library_free_data(ID *id)
}
}
+static void library_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ Library *lib = (Library *)id;
+ BKE_LIB_FOREACHID_PROCESS(data, lib->parent, IDWALK_CB_NEVER_SELF);
+}
+
IDTypeInfo IDType_ID_LI = {
.id_code = ID_LI,
.id_filter = 0,
@@ -67,6 +74,7 @@ IDTypeInfo IDType_ID_LI = {
.copy_data = NULL,
.free_data = library_free_data,
.make_local = NULL,
+ .foreach_id = library_foreach_id,
};
void BKE_library_filepath_set(Main *bmain, Library *lib, const char *filepath)