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>2011-12-20 06:04:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-20 06:04:35 +0400
commita7a6049978fc0789bce2064d6746c87277793cce (patch)
treec2f0561d6be11db58edba78609ac1e31f6f07e52
parent4d08df734cf9d8eab92844b28fdafdf3587e2fd1 (diff)
minor edits to previous commit & set VKey to toggle vertex select in weight paint mode.
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c10
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c6
2 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index c078de87d00..d0ef517e2ae 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -717,11 +717,15 @@ void vDM_ColorBand_store(ColorBand *coba)
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 @@ static unsigned char *calc_weightpaint_vert_array(Object *ob, int const draw_fla
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 */
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 2d0ad349be8..eb20465a2ab 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -605,9 +605,13 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
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);