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-02-22 22:31:25 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2009-02-22 22:31:25 +0300
commit674aae36b6fadf97613cc11758c32503b0f5f2f4 (patch)
treeaa9d55871c01e52cc6f623c1320bc4c955f6feac /source/blender/blenkernel
parent7c8d98acb83f0568b3db9c700f456d829d509cc3 (diff)
* Added radial control for texture paint (in both view3d and image)
* bugfix: for older files, initialize the brush curve on file load
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_brush.h4
-rw-r--r--source/blender/blenkernel/intern/brush.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index eba7558d492..4146d313d41 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -85,8 +85,8 @@ void brush_painter_free(BrushPainter *painter);
unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
/* radial control */
-void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br);
-int brush_radial_control_exec(struct wmOperator *op, struct Brush *br);
+void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br, float size_weight);
+int brush_radial_control_exec(struct wmOperator *op, struct Brush *br, float size_weight);
#endif
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index ab453fb6f44..e5dd9c2188d 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1053,13 +1053,13 @@ static struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
return im;
}
-void brush_radial_control_invoke(wmOperator *op, Brush *br)
+void brush_radial_control_invoke(wmOperator *op, Brush *br, float size_weight)
{
int mode = RNA_int_get(op->ptr, "mode");
float original_value= 0;
if(mode == WM_RADIALCONTROL_SIZE)
- original_value = br->size;
+ original_value = br->size * size_weight;
else if(mode == WM_RADIALCONTROL_STRENGTH)
original_value = br->alpha;
else if(mode == WM_RADIALCONTROL_ANGLE)
@@ -1069,14 +1069,14 @@ void brush_radial_control_invoke(wmOperator *op, Brush *br)
op->customdata = brush_gen_radial_control_imbuf(br);
}
-int brush_radial_control_exec(wmOperator *op, Brush *br)
+int brush_radial_control_exec(wmOperator *op, Brush *br, float size_weight)
{
int mode = RNA_int_get(op->ptr, "mode");
float new_value = RNA_float_get(op->ptr, "new_value");
const float conv = 0.017453293;
if(mode == WM_RADIALCONTROL_SIZE)
- br->size = new_value;
+ br->size = new_value * size_weight;
else if(mode == WM_RADIALCONTROL_STRENGTH)
br->alpha = new_value;
else if(mode == WM_RADIALCONTROL_ANGLE)