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>2011-01-08 01:46:52 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2011-01-08 01:46:52 +0300
commit2d9c11f3a3880f7be4524615d4d3e077254b4c87 (patch)
tree425eb186166e0bcd08bf1701a11bfbae8e5bf197 /source/blender/editors/sculpt_paint/paint_utils.c
parentab41b9bbaf677fb807e73df137156a44c941295b (diff)
Paint/Sculpt:
More minor cleanups: fixed names and factored out a function that was copy-pasted into paint stroke.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index cbd3a906207..6db8a5fd4ae 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -35,6 +35,23 @@
#include "paint_intern.h"
+float paint_calc_object_space_radius(ViewContext *vc, float center[3],
+ float pixel_radius)
+{
+ Object *ob = vc->obact;
+ float delta[3], scale, loc[3];
+
+ mul_v3_m4v3(loc, ob->obmat, center);
+
+ initgrabz(vc->rv3d, loc[0], loc[1], loc[2]);
+ window_to_3d_delta(vc->ar, delta, pixel_radius, 0);
+
+ scale= fabsf(mat4_to_scale(ob->obmat));
+ scale= (scale == 0.0f)? 1.0f: scale;
+
+ return len_v3(delta)/scale;
+}
+
float paint_get_tex_pixel(Brush* br, float u, float v)
{
TexResult texres;