[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42747] trunk/blender/source/blender: minor edits to previous commit & set VKey to toggle vertex select in weight paint mode .

Campbell Barton ideasman42 at gmail.com
Tue Dec 20 03:04:41 CET 2011


Revision: 42747
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42747
Author:   campbellbarton
Date:     2011-12-20 02:04:35 +0000 (Tue, 20 Dec 2011)
Log Message:
-----------
minor edits to previous commit & set VKey to toggle vertex select in weight paint mode.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2011-12-20 01:49:24 UTC (rev 42746)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2011-12-20 02:04:35 UTC (rev 42747)
@@ -717,11 +717,15 @@
 	stored_cb= coba;
 }
 
-/* return an array of vertex weight colors */
+/* return an array of vertex weight colors, caller must free.
+ *
+ * note that we could save some memory and allocate RGB only but then we'd need to
+ * re-arrange the colors when copying to the face since MCol has odd ordering,
+ * so leave this as is - campbell */
 static unsigned char *calc_weightpaint_vert_array(Object *ob, int const draw_flag, ColorBand *coba)
 {
 	Mesh *me = ob->data;
-	unsigned char *wtcol_v = MEM_callocN (sizeof(unsigned char) * me->totvert * 4, "weightmap_v");
+	unsigned char *wtcol_v = MEM_mallocN (sizeof(unsigned char) * me->totvert * 4, "weightmap_v");
 
 	if (me->dvert) {
 		unsigned char *wc = wtcol_v;
@@ -750,8 +754,6 @@
 	return wtcol_v;
 }
 
-#include "PIL_time.h"
-
 static void add_weight_mcol_dm(Object *ob, DerivedMesh *dm, int const draw_flag)
 {
 	ColorBand *coba= stored_cb;	/* warning, not a local var */

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c	2011-12-20 01:49:24 UTC (rev 42746)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c	2011-12-20 02:04:35 UTC (rev 42747)
@@ -605,9 +605,13 @@
 	ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size");
 	ed_keymap_paint_brush_radial_control(keymap, "weight_paint", 0);
 
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* face mask toggle */
 	RNA_string_set(kmi->ptr, "data_path", "weight_paint_object.data.use_paint_mask");
 
+	/* note, conflicts with vertex paint, but this is more useful */
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", VKEY, KM_PRESS, 0, 0); /* vert mask toggle */
+	RNA_string_set(kmi->ptr, "data_path", "weight_paint_object.data.use_paint_mask_vertex");
+
 	WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0);
 
 	




More information about the Bf-blender-cvs mailing list