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:
authorCampbell Barton <ideasman42@gmail.com>2010-11-04 00:23:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-04 00:23:02 +0300
commit81fe9d2d04f463c2bbaea599d067beeca6ae2dac (patch)
tree9a8ef75b88b5cd6e3624ec85885392168f930077 /source/blender/makesrna/intern/rna_sculpt_paint.c
parentee4b32c41a4a20cd82d10af7fefd9b20e29a77f3 (diff)
workaround [#24392] 2d Image paint editor: no clone/smear/soften tools etc
the brush system matches the brush mode with the object mode, but this doesn't work for 2D image view paint. since the poll() function doesnt have access to the context, for now just check if no paint modes are active, default to texture paint.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 3b83ec2d3ad..0fe3972104e 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -162,8 +162,19 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value)
Scene *scene= (Scene *)ptr->id.data;
Object *ob = OBACT;
Brush *brush= value.id.data;
- return ob->mode & brush->ob_mode;
+
+ /* weak, for object painting we need to check against the object mode
+ * but for 2D view image painting we always want texture brushes
+ * this is not quite correct since you could be in object weightpaint
+ * mode at the same time as the 2D image view, but for now its *good enough* */
+ if(ob->mode & OB_MODE_ALL_PAINT) {
+ return ob->mode & brush->ob_mode;
+ }
+ else {
+ return OB_MODE_TEXTURE_PAINT & brush->ob_mode;
+ }
}
+
#else
static void rna_def_paint(BlenderRNA *brna)