Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
/**
|
|
|
|
* $Id$
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
* General operations for brushes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BKE_BRUSH_H
|
|
|
|
#define BKE_BRUSH_H
|
|
|
|
|
|
|
|
struct ID;
|
|
|
|
struct Brush;
|
2006-07-31 15:53:03 +00:00
|
|
|
struct ImBuf;
|
2009-03-11 00:43:08 +00:00
|
|
|
struct Scene;
|
2009-01-25 07:28:11 +00:00
|
|
|
struct wmOperator;
|
2010-01-04 17:28:37 +00:00
|
|
|
enum CurveMappingPreset;
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
|
2006-07-31 15:53:03 +00:00
|
|
|
/* datablock functions */
|
2009-08-16 19:50:00 +00:00
|
|
|
struct Brush *add_brush(const char *name);
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
struct Brush *copy_brush(struct Brush *brush);
|
|
|
|
void make_local_brush(struct Brush *brush);
|
|
|
|
void free_brush(struct Brush *brush);
|
|
|
|
|
2006-07-31 15:53:03 +00:00
|
|
|
/* brush library operations used by different paint panels */
|
2009-08-17 02:49:31 +00:00
|
|
|
int brush_set_nr(struct Brush **current_brush, int nr, const char *name);
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
int brush_delete(struct Brush **current_brush);
|
2009-08-17 02:49:31 +00:00
|
|
|
void brush_check_exists(struct Brush **brush, const char *name);
|
2008-03-26 20:17:50 +00:00
|
|
|
void brush_toggled_fake_user(struct Brush *brush);
|
2006-07-31 15:53:03 +00:00
|
|
|
int brush_texture_set_nr(struct Brush *brush, int nr);
|
|
|
|
int brush_texture_delete(struct Brush *brush);
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
int brush_clone_image_set_nr(struct Brush *brush, int nr);
|
2006-07-31 15:53:03 +00:00
|
|
|
int brush_clone_image_delete(struct Brush *brush);
|
|
|
|
|
2009-01-07 04:38:30 +00:00
|
|
|
/* brush curve */
|
2010-01-08 01:39:41 +00:00
|
|
|
void brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset);
|
2009-09-24 01:32:23 +00:00
|
|
|
float brush_curve_strength_clamp(struct Brush *br, float p, const float len);
|
|
|
|
float brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
|
2009-01-07 04:38:30 +00:00
|
|
|
|
2006-07-31 15:53:03 +00:00
|
|
|
/* sampling */
|
2006-08-27 13:29:00 +00:00
|
|
|
void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
|
|
|
|
void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
|
|
|
|
struct ImBuf **imbuf);
|
2006-07-31 15:53:03 +00:00
|
|
|
|
|
|
|
/* painting */
|
|
|
|
struct BrushPainter;
|
|
|
|
typedef struct BrushPainter BrushPainter;
|
|
|
|
typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, float *lastpos, float *pos);
|
|
|
|
|
|
|
|
BrushPainter *brush_painter_new(struct Brush *brush);
|
2006-08-27 13:29:00 +00:00
|
|
|
void brush_painter_require_imbuf(BrushPainter *painter, short flt,
|
|
|
|
short texonly, int size);
|
|
|
|
int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos,
|
2006-09-24 19:29:25 +00:00
|
|
|
double time, float pressure, void *user);
|
2006-08-27 13:29:00 +00:00
|
|
|
void brush_painter_break_stroke(BrushPainter *painter);
|
2006-07-31 15:53:03 +00:00
|
|
|
void brush_painter_free(BrushPainter *painter);
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
|
2009-01-25 07:28:11 +00:00
|
|
|
/* texture */
|
|
|
|
unsigned int *brush_gen_texture_cache(struct Brush *br, int half_side);
|
|
|
|
|
|
|
|
/* radial control */
|
2009-02-22 19:31:25 +00:00
|
|
|
void brush_radial_control_invoke(struct wmOperator *op, struct Brush *br, float size_weight);
|
|
|
|
int brush_radial_control_exec(struct wmOperator *op, struct Brush *br, float size_weight);
|
2009-01-25 07:28:11 +00:00
|
|
|
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
#endif
|
|
|
|
|