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:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 11dbeffdb22..8184471c8d8 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -28,6 +28,7 @@
#include "BKE_paint.h"
#include "ED_sculpt.h"
+#include "ED_screen.h"
#include "UI_resources.h"
#include "WM_api.h"
@@ -52,7 +53,7 @@ static int brush_add_exec(bContext *C, wmOperator *op)
if(br)
paint_brush_set(paint_get_active(CTX_data_scene(C)), br);
-
+
return OPERATOR_FINISHED;
}
@@ -81,11 +82,12 @@ void BRUSH_OT_add(wmOperatorType *ot)
static int vertex_color_set_exec(bContext *C, wmOperator *op)
{
- int selected = RNA_boolean_get(op->ptr, "selected");
Scene *scene = CTX_data_scene(C);
-
- clear_vpaint(scene, selected);
+ Object *obact = CTX_data_active_object(C);
+ unsigned int paintcol = vpaint_get_current_col(scene->toolsettings->vpaint);
+ vpaint_fill(obact, paintcol);
+ ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
return OPERATOR_FINISHED;
}
@@ -101,8 +103,6 @@ void PAINT_OT_vertex_color_set(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_boolean(ot->srna, "selected", 0, "Type", "Only color selected faces.");
}
/**************************** registration **********************************/
@@ -126,6 +126,7 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(PAINT_OT_weight_paint_toggle);
WM_operatortype_append(PAINT_OT_weight_paint_radial_control);
WM_operatortype_append(PAINT_OT_weight_paint);
+ WM_operatortype_append(PAINT_OT_weight_set);
/* vertex */
WM_operatortype_append(PAINT_OT_vertex_paint_radial_control);
@@ -158,6 +159,9 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap,
+ "PAINT_OT_vertex_color_set",KKEY, KM_PRESS, KM_SHIFT, 0);
+
/* Weight Paint mode */
keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0);
keymap->poll= weight_paint_poll;
@@ -167,6 +171,9 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap,
+ "PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
+
/* Image/Texture Paint mode */
keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0);
keymap->poll= image_texture_paint_poll;