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:46:57 +0300
committerBastien Montagne <bastien@blender.org>2020-05-12 19:54:57 +0300
commit8ce0c9111db489854ba7c7b9110ea55f39f16c16 (patch)
tree3556dc3c91bdb8148cf49a415eb4cfdcc2944a2c /source/blender/blenkernel/intern/texture.c
parent5fd64c014fa02b98d650fd6934c0d07a74707c51 (diff)
Refactor: Move texture foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r--source/blender/blenkernel/intern/texture.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 0abee335036..49c5c073f49 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -57,6 +57,7 @@
#include "BKE_image.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
#include "BKE_material.h"
#include "BKE_node.h"
#include "BKE_scene.h"
@@ -123,6 +124,16 @@ static void texture_free_data(ID *id)
BKE_previewimg_free(&texture->preview);
}
+static void texture_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ Tex *texture = (Tex *)id;
+ if (texture->nodetree) {
+ /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
+ BKE_library_foreach_ID_embedded(data, (ID **)&texture->nodetree);
+ }
+ BKE_LIB_FOREACHID_PROCESS(data, texture->ima, IDWALK_CB_USER);
+}
+
IDTypeInfo IDType_ID_TE = {
.id_code = ID_TE,
.id_filter = FILTER_ID_TE,
@@ -137,6 +148,7 @@ IDTypeInfo IDType_ID_TE = {
.copy_data = texture_copy_data,
.free_data = texture_free_data,
.make_local = NULL,
+ .foreach_id = texture_foreach_id,
};
/* ****************** Mapping ******************* */