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:
authorHans Goudey <h.goudey@me.com>2022-05-17 14:06:14 +0300
committerHans Goudey <h.goudey@me.com>2022-05-17 14:06:14 +0300
commited62b65474f007025bc19d1f8758257b12cbc8b3 (patch)
treeaf034e94cc54b9acfd0ecbc632eed19bee4956c3 /source/blender/blenkernel/intern/paint.c
parent3ad5510427002a299e6d6b1856da2f910a116a82 (diff)
Cleanup: Use const in curves sculpt code
This makes it much clearer what data is supposed to be modified and what data is just used to influence the operation. The new `BKE_paint_brush_for_read` function isn't great design, but it can be removed or renamed if similar changes are applied to more places. Also pass pointers explicitly to `sample_curves_3d_brush` rather than reusing the `bContext`. This makes it clearer what data the function actually needs. Differential Revision: https://developer.blender.org/D14967
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index caada8da0de..cff7eb20b05 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -606,6 +606,11 @@ ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref)
Brush *BKE_paint_brush(Paint *p)
{
+ return (Brush *)BKE_paint_brush_for_read((const Paint *)p);
+}
+
+const Brush *BKE_paint_brush_for_read(const Paint *p)
+{
return p ? p->brush : NULL;
}