From 46cd2a6a38a67c7dfc3e5a8880b6f7f055e50a8a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 4 Jun 2012 07:29:45 +0000 Subject: Fix #31093: Brush's "Paint curve presets" in Image paint in UV\Image Editor doesn't work if weight paint mode is active Some operators like curve presets, color sample and some more were using object's mode to distinguish in which mode user is currently painting. Such approach fails in cases when there's paint mode active in 3D viewport and Image Editor. Changed logic here to use some context's state like active space which helps distinguishing current paint mode more accurate. Ported all areas which uses paint_get_active() to new paint_get_active_from_context(). There're still some calls to paint_get_active(), but that shouldn't be harmful due to that places indeed have object's mode as priority when getting paint mode. --- source/blender/blenkernel/BKE_paint.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenkernel/BKE_paint.h') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index b32b7145ff4..419fb4cedae 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -32,6 +32,7 @@ * \ingroup bke */ +struct bContext; struct Brush; struct MDisps; struct MeshElemMap; @@ -55,6 +56,7 @@ void free_paint(struct Paint *p); void copy_paint(struct Paint *src, struct Paint *tar); struct Paint *paint_get_active(struct Scene *sce); +struct Paint *paint_get_active_from_context(const struct bContext *C); struct Brush *paint_brush(struct Paint *paint); void paint_brush_set(struct Paint *paint, struct Brush *br); -- cgit v1.2.3