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-13 20:52:19 +0300
committerBastien Montagne <bastien@blender.org>2020-05-13 20:52:19 +0300
commit4da3044abccfb14153959832303325001ff2de1a (patch)
tree1e9189b1658c230e40bc4becc97041babb2b9c1a /source/blender/blenkernel/intern/brush.c
parente4890fa564f2b798d48274b34a563e23f6f32bf5 (diff)
Refactor: Move brush foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 0e6b9409404..c21dec16555 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -181,6 +181,20 @@ static void brush_make_local(Main *bmain, ID *id, const int flags)
}
}
+static void brush_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ Brush *brush = (Brush *)id;
+
+ BKE_LIB_FOREACHID_PROCESS(data, brush->toggle_brush, IDWALK_CB_NOP);
+ BKE_LIB_FOREACHID_PROCESS(data, brush->clone.image, IDWALK_CB_NOP);
+ BKE_LIB_FOREACHID_PROCESS(data, brush->paint_curve, IDWALK_CB_USER);
+ if (brush->gpencil_settings) {
+ BKE_LIB_FOREACHID_PROCESS(data, brush->gpencil_settings->material, IDWALK_CB_USER);
+ }
+ BKE_texture_mtex_foreach_id(data, &brush->mtex);
+ BKE_texture_mtex_foreach_id(data, &brush->mask_mtex);
+}
+
IDTypeInfo IDType_ID_BR = {
.id_code = ID_BR,
.id_filter = FILTER_ID_BR,
@@ -195,6 +209,7 @@ IDTypeInfo IDType_ID_BR = {
.copy_data = brush_copy_data,
.free_data = brush_free_data,
.make_local = brush_make_local,
+ .foreach_id = brush_foreach_id,
};
static RNG *brush_rng;