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:43:08 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2009-03-11 03:43:08 +0300
commit33509e851077fa108bfb1e8934098d67e6b1b16f (patch)
tree1c464e1fcb10b4549eb90cb4becd77c3531d269b /source/blender/editors/sculpt_paint/paint_utils.c
parent47311475ba16b59b7e5751cc63d5800bdd971586 (diff)
Changed vertexpaint and weightpaint to use the standard Brush struct, so they too work with the brush panel.
Note: these modes are only using color/alpha/size from Brush, so there's more integration work todo yet.
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, 6 insertions, 15 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index e0ac3c94109..85ea55331dc 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -11,6 +11,7 @@
#include "BLI_arithb.h"
+#include "BKE_brush.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_utildefines.h"
@@ -159,7 +160,7 @@ int imapaint_pick_face(ViewContext *vc, Mesh *me, int *mval, unsigned int *index
/* used for both 3d view and image window */
void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
{
- VPaint *vp= scene->toolsettings->vpaint;
+ Brush **br = current_brush_source(scene);
unsigned int col;
char *cp;
@@ -172,20 +173,10 @@ void paint_sample_color(Scene *scene, ARegion *ar, int x, int y) /* frontbuf */
cp = (char *)&col;
- if(G.f & (G_VERTEXPAINT|G_WEIGHTPAINT)) {
- vp->r= cp[0]/255.0f;
- vp->g= cp[1]/255.0f;
- vp->b= cp[2]/255.0f;
- }
- else {
- Brush *brush= scene->toolsettings->imapaint.brush;
-
- if(brush) {
- brush->rgb[0]= cp[0]/255.0f;
- brush->rgb[1]= cp[1]/255.0f;
- brush->rgb[2]= cp[2]/255.0f;
-
- }
+ if(br && *br) {
+ (*br)->rgb[0]= cp[0]/255.0f;
+ (*br)->rgb[1]= cp[1]/255.0f;
+ (*br)->rgb[2]= cp[2]/255.0f;
}
}