option to lock alpha while projection painting.
[blender.git] / source / blender / makesdna / DNA_brush_types.h
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. 
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * The Original Code is Copyright (C) 2005 Blender Foundation.
21  * All rights reserved.
22  *
23  * The Original Code is: all of this file.
24  *
25  * Contributor(s): none yet.
26  *
27  * ***** END GPL LICENSE BLOCK *****
28  */
29
30 #ifndef DNA_BRUSH_TYPES_H
31 #define DNA_BRUSH_TYPES_H
32
33 #include "DNA_ID.h"
34 #include "DNA_texture_types.h"
35
36 #ifndef MAX_MTEX
37 #define MAX_MTEX        18
38 #endif
39
40 struct CurveMapping;
41 struct MTex;
42 struct Image;
43
44 typedef struct BrushClone {
45         struct Image *image;            /* image for clone tool */
46         float offset[2];                        /* offset of clone image from canvas */
47         float alpha, pad;                       /* transparency for drawing of clone image */
48 } BrushClone;
49
50 typedef struct Brush {
51         ID id;
52
53         struct BrushClone clone;
54         struct CurveMapping *curve;     /* falloff curve */
55         struct MTex mtex;
56         
57         short flag, blend;                      /* general purpose flag, blend mode */
58         int size;                                       /* brush diameter */
59         float jitter;                           /* jitter the position of the brush */
60         float spacing;                          /* spacing of paint operations */
61         int smooth_stroke_radius;               /* turning radius (in pixels) for smooth stroke */
62         float smooth_stroke_factor;             /* higher values limit fast changes in the stroke direction */
63         float rate;                                     /* paint operations / second (airbrush) */
64
65         float rgb[3];                           /* color */
66         float alpha;                            /* opacity */
67
68         char sculpt_tool;                       /* active sculpt tool */
69         char vertexpaint_tool;          /* active vertex/weight paint tool/blend mode */
70         char imagepaint_tool;           /* active image paint tool */
71         char pad2;
72 } Brush;
73
74 /* Brush.flag */
75 #define BRUSH_AIRBRUSH                  1
76 #define BRUSH_TORUS                             2
77 #define BRUSH_ALPHA_PRESSURE    4
78 #define BRUSH_SIZE_PRESSURE             8
79 #define BRUSH_JITTER_PRESSURE   16 /* was BRUSH_RAD_PRESSURE */
80 #define BRUSH_SPACING_PRESSURE  32
81 #define BRUSH_FIXED_TEX                 64
82 #define BRUSH_RAKE                              128
83 #define BRUSH_ANCHORED                  256
84 #define BRUSH_DIR_IN                    512
85 #define BRUSH_SPACE                             1024
86 #define BRUSH_SMOOTH_STROKE             2048
87 #define BRUSH_PERSISTENT                4096
88 #define BRUSH_ACCUMULATE                8192
89 #define BRUSH_LOCK_ALPHA                16384
90
91 /* Brush.sculpt_tool */
92 #define SCULPT_TOOL_DRAW    1
93 #define SCULPT_TOOL_SMOOTH  2
94 #define SCULPT_TOOL_PINCH   3
95 #define SCULPT_TOOL_INFLATE 4
96 #define SCULPT_TOOL_GRAB    5
97 #define SCULPT_TOOL_LAYER   6
98 #define SCULPT_TOOL_FLATTEN 7
99 #define SCULPT_TOOL_CLAY    8
100
101 /* ImagePaintSettings.tool */
102 #define PAINT_TOOL_DRAW         0
103 #define PAINT_TOOL_SOFTEN       1
104 #define PAINT_TOOL_SMEAR        2
105 #define PAINT_TOOL_CLONE        3
106
107 #endif
108