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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-08-20 13:41:16 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-08-20 13:41:16 +0400
commit4c094d700e874ad55fd980948e6aa5d6dedb8ff3 (patch)
tree2911a5079908b8428457c661bf62a45d01c972ea /source/blender/editors
parent07cfb4f4f5b6d8988fe7a40424bab682dcf124e9 (diff)
Fix #23336: radial control crashing or not showing correct colors in modes
other than sculpt. The sculpt changes made the radial control code sculpt mode specific, it should be usable for various purposes, so made it generic again now.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c12
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c14
2 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 553343a8b21..669ec07b7ed 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1144,10 +1144,16 @@ static int vpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *ev
{
Paint *p = paint_get_active(CTX_data_scene(C));
Brush *brush = paint_brush(p);
+ float col[4];
WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor);
p->paint_cursor = NULL;
brush_radial_control_invoke(op, brush, 1);
+
+ copy_v3_v3(col, brush->add_col);
+ col[3]= 0.5f;
+ RNA_float_set_array(op->ptr, "color", col);
+
return WM_radial_control_invoke(C, op, event);
}
@@ -1173,10 +1179,16 @@ static int wpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *ev
{
Paint *p = paint_get_active(CTX_data_scene(C));
Brush *brush = paint_brush(p);
+ float col[4];
WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor);
p->paint_cursor = NULL;
brush_radial_control_invoke(op, brush, 1);
+
+ copy_v3_v3(col, brush->add_col);
+ col[3]= 0.5f;
+ RNA_float_set_array(op->ptr, "color", col);
+
return WM_radial_control_invoke(C, op, event);
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index d8df9684cff..10af35a1b4b 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2726,10 +2726,24 @@ static int sculpt_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *ev
{
Paint *p = paint_get_active(CTX_data_scene(C));
Brush *brush = paint_brush(p);
+ float col[4], tex_col[4];
WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor);
p->paint_cursor = NULL;
brush_radial_control_invoke(op, brush, 1);
+
+ if((brush->flag & BRUSH_DIR_IN) && ELEM4(brush->sculpt_tool, SCULPT_TOOL_DRAW, SCULPT_TOOL_INFLATE, SCULPT_TOOL_CLAY, SCULPT_TOOL_PINCH))
+ copy_v3_v3(col, brush->sub_col);
+ else
+ copy_v3_v3(col, brush->add_col);
+ col[3]= 0.5f;
+
+ copy_v3_v3(tex_col, U.sculpt_paint_overlay_col);
+ tex_col[3]= (brush->texture_overlay_alpha / 100.0f);
+
+ RNA_float_set_array(op->ptr, "color", col);
+ RNA_float_set_array(op->ptr, "texture_color", tex_col);
+
return WM_radial_control_invoke(C, op, event);
}