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-20 17:40:58 +0300
committerBastien Montagne <bastien@blender.org>2020-05-20 19:43:46 +0300
commit4d613018eeb5ec7032135c2f72a9ef635616543d (patch)
treef26c2c34f6282a536cc84c71202a88ea58671e98 /source/blender/blenkernel/intern/hair.c
parente2d961809b20a98b155c4492f705c3ea691e4f2c (diff)
Refactor: Move hair foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel/intern/hair.c')
-rw-r--r--source/blender/blenkernel/intern/hair.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/hair.c b/source/blender/blenkernel/intern/hair.c
index 4e15067288b..90761d24b73 100644
--- a/source/blender/blenkernel/intern/hair.c
+++ b/source/blender/blenkernel/intern/hair.c
@@ -22,6 +22,7 @@
#include "DNA_defaults.h"
#include "DNA_hair_types.h"
+#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "BLI_listbase.h"
@@ -95,6 +96,14 @@ static void hair_free_data(ID *id)
MEM_SAFE_FREE(hair->mat);
}
+static void hair_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ Hair *hair = (Hair *)id;
+ for (int i = 0; i < hair->totcol; i++) {
+ BKE_LIB_FOREACHID_PROCESS(data, hair->mat[i], IDWALK_CB_USER);
+ }
+}
+
IDTypeInfo IDType_ID_HA = {
.id_code = ID_HA,
.id_filter = FILTER_ID_HA,
@@ -109,6 +118,7 @@ IDTypeInfo IDType_ID_HA = {
.copy_data = hair_copy_data,
.free_data = hair_free_data,
.make_local = NULL,
+ .foreach_id = hair_foreach_id,
};
static void hair_random(Hair *hair)