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:58:56 +0300
committerBastien Montagne <bastien@blender.org>2020-05-20 19:43:46 +0300
commitee442833930ce5c29aa015c273eea784b583348e (patch)
tree875fa27fa2b9eccbe05651add162a561f0462700 /source/blender/blenkernel/intern/pointcloud.c
parent2059b30ee2d1f7018c4d1c18c68027db7d22ec63 (diff)
Refactor: Move pointcloud and volume foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel/intern/pointcloud.c')
-rw-r--r--source/blender/blenkernel/intern/pointcloud.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pointcloud.c b/source/blender/blenkernel/intern/pointcloud.c
index 1639f0b0899..e03888dcad7 100644
--- a/source/blender/blenkernel/intern/pointcloud.c
+++ b/source/blender/blenkernel/intern/pointcloud.c
@@ -21,6 +21,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
+#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_pointcloud_types.h"
@@ -89,6 +90,14 @@ static void pointcloud_free_data(ID *id)
MEM_SAFE_FREE(pointcloud->mat);
}
+static void pointcloud_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ PointCloud *pointcloud = (PointCloud *)id;
+ for (int i = 0; i < pointcloud->totcol; i++) {
+ BKE_LIB_FOREACHID_PROCESS(data, pointcloud->mat[i], IDWALK_CB_USER);
+ }
+}
+
IDTypeInfo IDType_ID_PT = {
.id_code = ID_PT,
.id_filter = FILTER_ID_PT,
@@ -103,6 +112,7 @@ IDTypeInfo IDType_ID_PT = {
.copy_data = pointcloud_copy_data,
.free_data = pointcloud_free_data,
.make_local = NULL,
+ .foreach_id = pointcloud_foreach_id,
};
static void pointcloud_random(PointCloud *pointcloud)