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:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-03-11 03:52:00 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2009-03-11 03:52:00 +0300
commit891c3bc663b0f1ece07bfd48e06853a9eedb6178 (patch)
tree6ca7368bec2980deacb65126598f41d602e37d7c /source/blender/editors/sculpt_paint
parent33509e851077fa108bfb1e8934098d67e6b1b16f (diff)
Simplified vpaint/wpaint radial control calls. Removed also some unused radial control code.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c40
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
2 files changed, 5 insertions, 41 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 60b1fc04064..0c20c0cc1cf 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1171,36 +1171,10 @@ void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
/* ************ paint radial controls *************/
-void paint_radial_control_invoke(wmOperator *op, VPaint *vp)
-{
- int mode = RNA_int_get(op->ptr, "mode");
- float original_value;
-
- if(mode == WM_RADIALCONTROL_SIZE)
- original_value = vp->brush->size;
- else if(mode == WM_RADIALCONTROL_STRENGTH)
- original_value = vp->brush->alpha;
-
- RNA_float_set(op->ptr, "initial_value", original_value);
-}
-
-static int paint_radial_control_exec(wmOperator *op, VPaint *vp)
-{
- int mode = RNA_int_get(op->ptr, "mode");
- float new_value = RNA_float_get(op->ptr, "new_value");
-
- if(mode == WM_RADIALCONTROL_SIZE)
- vp->brush->size = new_value;
- else if(mode == WM_RADIALCONTROL_STRENGTH)
- vp->brush->alpha = new_value;
-
- return OPERATOR_FINISHED;
-}
-
static int vpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
toggle_paint_cursor(C, 0);
- paint_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->vpaint);
+ brush_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->vpaint->brush, 1);
return WM_radial_control_invoke(C, op, event);
}
@@ -1214,16 +1188,13 @@ static int vpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
static int vpaint_radial_control_exec(bContext *C, wmOperator *op)
{
- int ret = paint_radial_control_exec(op, CTX_data_scene(C)->toolsettings->vpaint);
- char str[256];
- WM_radial_control_string(op, str, 256);
- return ret;
+ return brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->vpaint->brush, 1);
}
static int wpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
toggle_paint_cursor(C, 1);
- paint_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->wpaint);
+ brush_radial_control_invoke(op, CTX_data_scene(C)->toolsettings->wpaint->brush, 1);
return WM_radial_control_invoke(C, op, event);
}
@@ -1237,10 +1208,7 @@ static int wpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
static int wpaint_radial_control_exec(bContext *C, wmOperator *op)
{
- int ret = paint_radial_control_exec(op, CTX_data_scene(C)->toolsettings->wpaint);
- char str[256];
- WM_radial_control_string(op, str, 256);
- return ret;
+ return brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->wpaint->brush, 1);
}
void PAINT_OT_weight_paint_radial_control(wmOperatorType *ot)
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index d9616f95a05..8f1e3826314 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -1275,11 +1275,7 @@ static int sculpt_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve
static int sculpt_radial_control_exec(bContext *C, wmOperator *op)
{
- int ret = brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->sculpt->brush, 1);
- char str[256];
- WM_radial_control_string(op, str, 256);
-
- return ret;
+ return brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->sculpt->brush, 1);
}
static void SCULPT_OT_radial_control(wmOperatorType *ot)