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:03:16 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2011-01-08 01:03:16 +0300
commitab41b9bbaf677fb807e73df137156a44c941295b (patch)
tree454dbba1df45b98dd18d06ec84eb593c990e0dd0 /source/blender/editors/sculpt_paint/paint_utils.c
parent473838aec99d81595def7634d61a48118e84b8ff (diff)
Paint/Sculpt:
Some minor cleanups: removed `#if 0' code and moved a function into paint_util to avoid `extern' declaration.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 52cee23194b..cbd3a906207 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -22,6 +22,8 @@
#include "BIF_gl.h"
+#include "RE_shader_ext.h"
+
#include "ED_view3d.h"
#include "ED_screen.h"
@@ -33,6 +35,25 @@
#include "paint_intern.h"
+float paint_get_tex_pixel(Brush* br, float u, float v)
+{
+ TexResult texres;
+ float co[3];
+ int hasrgb;
+
+ co[0] = u;
+ co[1] = v;
+ co[2] = 0;
+
+ memset(&texres, 0, sizeof(TexResult));
+ hasrgb = multitex_ext(br->mtex.tex, co, NULL, NULL, 1, &texres);
+
+ if (hasrgb & TEX_RGB)
+ texres.tin = (0.35*texres.tr + 0.45*texres.tg + 0.2*texres.tb)*texres.ta;
+
+ return texres.tin;
+}
+
/* 3D Paint */
static void imapaint_project(Object *ob, float *model, float *proj, float *co, float *pco)