diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-22 12:19:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-22 12:19:27 +0400 |
commit | a735a2370b1e85dc555550cd604cf0434567d7ac (patch) | |
tree | a56232a3a451d4147334901d1f0a9e9c628724b1 /source/blender/editors/sculpt_paint/paint_ops.c | |
parent | 2abb727ced258796bf54aff637c502cd6554efb7 (diff) |
Weight gradient tool for weight paint mode
- blends from current weight into alpha zero.
- uses brush alpha & curve.
- respects weight paint vertex/face select modes.
- updates realtime.
Access With
- Alt+LMB (linear gradient)
- Ctrl+Alt+LMB (radial gradient)
note:
- WM_gesture_straightline_* are used but not well suited to this task, may end up replacing with own modal operator.
- Key handling works but needs to be done better.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 40dcb92f087..10b9f26dbcd 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -475,6 +475,7 @@ void ED_operatortypes_paint(void) WM_operatortype_append(PAINT_OT_weight_paint); WM_operatortype_append(PAINT_OT_weight_set); WM_operatortype_append(PAINT_OT_weight_from_bones); + WM_operatortype_append(PAINT_OT_weight_gradient); WM_operatortype_append(PAINT_OT_weight_sample); WM_operatortype_append(PAINT_OT_weight_sample_group); @@ -710,6 +711,9 @@ void ED_keymap_paint(wmKeyConfig *keyconf) WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "PAINT_OT_weight_sample_group", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); + RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_gradient", LEFTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "type", WPAINT_GRADIENT_TYPE_LINEAR); + RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_gradient", LEFTMOUSE, KM_PRESS, KM_ALT | KM_CTRL, 0)->ptr, "type", WPAINT_GRADIENT_TYPE_RADIAL); + WM_keymap_add_item(keymap, "PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0); |