diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-07-28 04:56:35 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-07-28 04:56:35 +0400 |
commit | f893d950a1524d1069963dde251d48143063ad51 (patch) | |
tree | 30b8a54e5fd3bcdb059346a77337d68fdfca7180 /source/blender/src/vpaint.c | |
parent | 3d0f27c19d943f5bb9e3052b0c6a03313a16bbb0 (diff) |
Image Paint:
- Code for brush spacing and timing was rewritten, making spacing more even.
Example: http://users.pandora.be/blendix/brush_spacing.jpg
- Instead of Stepsize for regular brushes and Flow for airbrushes, there is
now Spacing for both, and Rate for airbrushes.
- Airbrush now works more like it does in the Gimp now, by maintaining the
spacing even if the brush moves faster than the painting rate.
- Some preparations to make brushes work in texture paint mode.
Diffstat (limited to 'source/blender/src/vpaint.c')
-rw-r--r-- | source/blender/src/vpaint.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index d1b903d08c6..811486eb35a 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -50,6 +50,7 @@ #include "DNA_action_types.h" #include "DNA_armature_types.h" +#include "DNA_brush_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" @@ -534,14 +535,20 @@ void sample_vpaint() /* frontbuf */ cp = (char *)&col; - Gvp.r= cp[0]; - Gvp.r /= 255.0; - - Gvp.g= cp[1]; - Gvp.g /= 255.0; + if(G.f & (G_VERTEXPAINT|G_WEIGHTPAINT)) { + Gvp.r= cp[0]/255.0f; + Gvp.g= cp[1]/255.0f; + Gvp.b= cp[2]/255.0f; + } + else { + Brush *brush= G.scene->toolsettings->imapaint.brush; - Gvp.b= cp[2]; - Gvp.b /= 255.0; + if(brush) { + brush->rgb[0]= cp[0]/255.0f; + brush->rgb[1]= cp[1]/255.0f; + brush->rgb[2]= cp[2]/255.0f; + } + } allqueue(REDRAWBUTSEDIT, 0); addqueue(curarea->win, REDRAW, 1); /* needed for when panel is open... */ |