[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60673] trunk/blender/source/blender/ editors/sculpt_paint: fix [#37031] bones are not selectable in weight paint mode anymore

Campbell Barton ideasman42 at gmail.com
Thu Oct 10 22:23:24 CEST 2013


Revision: 60673
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60673
Author:   campbellbarton
Date:     2013-10-10 20:23:24 +0000 (Thu, 10 Oct 2013)
Log Message:
-----------
fix [#37031] bones are not selectable in weight paint mode anymore

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h
    trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h	2013-10-10 20:22:17 UTC (rev 60672)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h	2013-10-10 20:23:24 UTC (rev 60673)
@@ -74,6 +74,7 @@
 bool paint_supports_dynamic_size(struct Brush *br, enum PaintMode mode);
 bool paint_supports_dynamic_tex_coords(struct Brush *br, enum PaintMode mode);
 bool paint_supports_smooth_stroke(struct Brush *br, enum PaintMode mode);
+bool paint_supports_texture(enum PaintMode mode);
 bool paint_supports_jitter(enum PaintMode mode);
 
 struct wmKeyMap *paint_stroke_modal_keymap(struct wmKeyConfig *keyconf);

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c	2013-10-10 20:22:17 UTC (rev 60672)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c	2013-10-10 20:23:24 UTC (rev 60673)
@@ -728,9 +728,16 @@
 
 static int stencil_control_poll(bContext *C)
 {
-	Paint *paint = BKE_paint_get_active_from_context(C);
-	Brush *br = BKE_paint_brush(paint);
+	PaintMode mode = BKE_paintmode_get_active_from_context(C);
 
+	Paint *paint;
+	Brush *br;
+
+	if (!paint_supports_texture(mode))
+		return false;
+
+	paint = BKE_paint_get_active_from_context(C);
+	br = BKE_paint_brush(paint);
 	return (br &&
 	        (br->mtex.brush_map_mode == MTEX_MAP_MODE_STENCIL ||
 	         br->mask_mtex.brush_map_mode == MTEX_MAP_MODE_STENCIL));

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-10-10 20:22:17 UTC (rev 60672)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2013-10-10 20:23:24 UTC (rev 60673)
@@ -572,6 +572,12 @@
 	return true;
 }
 
+bool paint_supports_texture(PaintMode mode)
+{
+	/* ommit: PAINT_WEIGHT, PAINT_SCULPT_UV, PAINT_INVALID */
+	return ELEM4(mode, PAINT_SCULPT, PAINT_VERTEX, PAINT_TEXTURE_PROJECTIVE, PAINT_TEXTURE_2D);
+}
+
 /* return true if the brush size can change during paint (normally used for pressure) */
 bool paint_supports_dynamic_tex_coords(Brush *br, PaintMode mode)
 {




More information about the Bf-blender-cvs mailing list