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:
authorTon Roosendaal <ton@blender.org>2006-06-29 17:46:39 +0400
committerTon Roosendaal <ton@blender.org>2006-06-29 17:46:39 +0400
commitd90b676bbba82cf380f97d61fd74e8fc5577e7b1 (patch)
tree4d91b4ec06cc4615368991fab3d8874f91726f10 /source/blender
parent0735bf0ae144b6cad1470c4e3d94bf4b4e10b13f (diff)
Bugfix #4530
Weightpaint fix. Weight painting was recoded in 2.40 to support all features from vertex paint. That code uses a 'soft' brush by default, which makes it impossible to assign exact weight values on a single click (which used to be possible) I've made that an option now, so you can disable it for single-click setting of values on vertices within the brush (if 'use vertex distances' is set, of course).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/include/blendef.h1
-rw-r--r--source/blender/src/buttons_editing.c19
-rw-r--r--source/blender/src/vpaint.c6
3 files changed, 16 insertions, 10 deletions
diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h
index 0b2ca31a579..3dd0dda31d3 100644
--- a/source/blender/include/blendef.h
+++ b/source/blender/include/blendef.h
@@ -415,5 +415,6 @@
#define VP_NORMALS 8
#define VP_SPRAY 16
#define VP_MIRROR_X 32
+#define VP_HARD 64
#endif
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index b63567efbb2..f5066402927 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -3852,7 +3852,7 @@ static void editing_panel_mesh_paint(void)
uiDefBut(block, BUT, B_OPA3_4 , "3/4", 145,100,45,19, 0, 0, 0, 0, 0, "");
uiDefBut(block, BUT, B_OPA1_0 , "1", 190,100,45,19, 0, 0, 0, 0, 0, "");
- uiDefButF(block, NUMSLI, B_NOP, "Size ", 10,80,225,19, &Gwp.size, 2.0, 64.0, 0, 0, "The size of the brush");
+ uiDefButF(block, NUMSLI, B_NOP, "Size ", 10,80,225,19, &Gwp.size, 2.0, 64.0, 0, 0, "The size of the brush");
uiBlockBeginAlign(block);
uiDefButS(block, ROW, B_DIFF, "Mix", 250,160,60,17, &Gwp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colors");
@@ -3862,18 +3862,21 @@ static void editing_panel_mesh_paint(void)
uiDefButS(block, ROW, B_DIFF, "Filter", 250, 88,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Mix the colors with an alpha factor");
uiDefButS(block, ROW, B_DIFF, "Lighter", 250, 70,60,17, &Gwp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
uiDefButS(block, ROW, B_DIFF, "Darker", 250, 52,60,17, &Gwp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
+ uiBlockEndAlign(block);
+
+ uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 160,55,75,19, &Gwp.flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse");
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 10,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Paint on all faces inside brush");
- uiDefButBitS(block, TOG, VP_SOFT, 0, "Vertex Dist", 85,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Use distances to vertices (instead of paint entire faces)");
- uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 160,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting");
- uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 235,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse");
+ uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 10,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Paint on all faces inside brush (otherwise only on face under mouse cursor)");
+ uiDefButBitS(block, TOG, VP_SOFT, 0, "Vertex Dist", 85,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Use distances to vertices (instead of all vertices of face)");
+ uiDefButBitS(block, TOGN, VP_HARD, 0, "Soft", 160,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Use a soft brush");
+ uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 235,30,75,19, &Gwp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting");
if(ob){
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, VP_MIRROR_X, REDRAWVIEW3D, "X-Mirror", 10,0,100,19, &Gwp.flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name");
- uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 110,0,100,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes");
- uiDefBut(block, BUT, B_CLR_WPAINT, "Clear", 210,0,100,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices");
+ uiDefButBitS(block, TOG, VP_MIRROR_X, REDRAWVIEW3D, "X-Mirror", 10,-10,100,19, &Gwp.flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name");
+ uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 110,-10,100,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes");
+ uiDefBut(block, BUT, B_CLR_WPAINT, "Clear", 210,-10,100,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices");
uiBlockEndAlign(block);
}
}
diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c
index 6d04fc9104e..d1b903d08c6 100644
--- a/source/blender/src/vpaint.c
+++ b/source/blender/src/vpaint.c
@@ -830,8 +830,10 @@ static int calc_vp_alpha_dl(VPaint *vp, float *vert_nor, short *mval)
fac= sqrt(dx*dx + dy*dy);
if(fac > vp->size) return 0;
-
- alpha= 255.0*vp->a*(1.0-fac/vp->size);
+ if(vp->flag & VP_HARD)
+ alpha= 255;
+ else
+ alpha= 255.0*vp->a*(1.0-fac/vp->size);
}
else {
alpha= 255.0*vp->a;