* Polish preset did not enable tablet pressure for strength
[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 // XXX Not used?
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         struct ImBuf *icon_imbuf;
58         char icon;
59         char pad2[7];
60         PreviewImage *preview;
61         char icon_filepath[240];
62
63         float normal_weight;
64
65         short blend, pad;               /* blend mode */
66         int size;                       /* brush diameter */
67         int flag;                       /* general purpose flag */      
68         float jitter;                   /* jitter the position of the brush */
69         int spacing;                    /* spacing of paint operations */
70         int smooth_stroke_radius;       /* turning radius (in pixels) for smooth stroke */
71         float smooth_stroke_factor;     /* higher values limit fast changes in the stroke direction */
72         float rate;                     /* paint operations / second (airbrush) */
73
74         float rgb[3];                   /* color */
75         float alpha;                    /* opacity */
76
77         int sculpt_plane;               /* the direction of movement for sculpt vertices */
78
79         float plane_offset;             /* offset for plane brushes (clay, flatten, fill, scrape) */
80
81         char sculpt_tool;               /* active sculpt tool */
82         char vertexpaint_tool;          /* active vertex/weight paint tool/blend mode */
83         char imagepaint_tool;           /* active image paint tool */
84         char pad3;
85
86         float autosmooth_factor;
87
88         float crease_pinch_factor;
89
90         float plane_trim;
91
92         float texture_sample_bias;
93         int   texture_overlay_alpha;
94
95         float unprojected_radius;
96
97         float add_col[3];
98         float sub_col[3];
99 } Brush;
100
101 /* Brush.flag */
102 #define BRUSH_AIRBRUSH          (1<<0)
103 #define BRUSH_TORUS             (1<<1)
104 #define BRUSH_ALPHA_PRESSURE    (1<<2)
105 #define BRUSH_SIZE_PRESSURE     (1<<3)
106 #define BRUSH_JITTER_PRESSURE   (1<<4) /* was BRUSH_RAD_PRESSURE */
107 #define BRUSH_SPACING_PRESSURE  (1<<5)
108 #define BRUSH_FIXED_TEX         (1<<6)
109 #define BRUSH_RAKE              (1<<7)
110 #define BRUSH_ANCHORED          (1<<8)
111 #define BRUSH_DIR_IN            (1<<9)
112 #define BRUSH_SPACE             (1<<10)
113 #define BRUSH_SMOOTH_STROKE     (1<<11)
114 #define BRUSH_PERSISTENT        (1<<12)
115 #define BRUSH_ACCUMULATE        (1<<13)
116 #define BRUSH_LOCK_ALPHA        (1<<14)
117 #define BRUSH_ORIGINAL_NORMAL   (1<<15)
118 #define BRUSH_OFFSET_PRESSURE   (1<<16)
119 #define BRUSH_SPACE_ATTEN       (1<<18)
120 #define BRUSH_ADAPTIVE_SPACE    (1<<19)
121 #define BRUSH_LOCK_SIZE         (1<<20)
122 #define BRUSH_TEXTURE_OVERLAY   (1<<21)
123 #define BRUSH_EDGE_TO_EDGE      (1<<22)
124 #define BRUSH_RESTORE_MESH      (1<<23)
125 #define BRUSH_INVERSE_SMOOTH_PRESSURE (1<<24)
126 #define BRUSH_RANDOM_ROTATION (1<<25)
127 #define BRUSH_PLANE_TRIM (1<<26)
128 #define BRUSH_FRONTFACE (1<<27)
129
130 /* Brush.sculpt_tool */
131 #define SCULPT_TOOL_DRAW        1
132 #define SCULPT_TOOL_SMOOTH      2
133 #define SCULPT_TOOL_PINCH       3
134 #define SCULPT_TOOL_INFLATE     4
135 #define SCULPT_TOOL_GRAB        5
136 #define SCULPT_TOOL_LAYER       6
137 #define SCULPT_TOOL_FLATTEN     7
138 #define SCULPT_TOOL_CLAY        8
139 #define SCULPT_TOOL_FILL        9
140 #define SCULPT_TOOL_SCRAPE     10
141 #define SCULPT_TOOL_NUDGE      11
142 #define SCULPT_TOOL_THUMB      12
143 #define SCULPT_TOOL_SNAKE_HOOK 13
144 #define SCULPT_TOOL_ROTATE     14
145 //#define SCULPT_TOOL_WAX        15 // XXX: reuse this slot later
146 #define SCULPT_TOOL_CREASE     16
147 #define SCULPT_TOOL_BLOB       17
148 #define SCULPT_TOOL_CLAY_TUBES 18
149
150 /* Internal Icons */
151 #define BRUSH_ICON_FILE        0
152
153 #define BRUSH_ICON_BLOB        1
154 #define BRUSH_ICON_CLAY        2
155 #define BRUSH_ICON_CREASE      3
156 #define BRUSH_ICON_SCULPTDRAW        4
157 #define BRUSH_ICON_FILL        5
158 #define BRUSH_ICON_FLATTEN     6
159 #define BRUSH_ICON_GRAB        7
160 #define BRUSH_ICON_INFLATE     8
161 #define BRUSH_ICON_LAYER       9
162 #define BRUSH_ICON_NUDGE      10
163 #define BRUSH_ICON_PINCH      11
164 #define BRUSH_ICON_SCRAPE     12
165 #define BRUSH_ICON_SMOOTH     13
166 #define BRUSH_ICON_SNAKE_HOOK 14
167 #define BRUSH_ICON_THUMB      15
168 #define BRUSH_ICON_TWIST      16
169
170 #define BRUSH_ICON_ADD        17
171 #define BRUSH_ICON_BLUR       18
172 #define BRUSH_ICON_CLONE      19
173 #define BRUSH_ICON_DARKEN     20
174 #define BRUSH_ICON_LIGHTEN    21
175 #define BRUSH_ICON_MIX        22
176 #define BRUSH_ICON_MULTIPLY   23
177 #define BRUSH_ICON_SMEAR      24
178 #define BRUSH_ICON_SOFTEN     25
179 #define BRUSH_ICON_SUBTRACT   26
180 #define BRUSH_ICON_TEXDRAW    27
181 #define BRUSH_ICON_VERTEXDRAW 28
182
183 #define BRUSH_ICON_COUNT      29
184
185 /* ImagePaintSettings.tool */
186 #define PAINT_TOOL_DRAW         0
187 #define PAINT_TOOL_SOFTEN       1
188 #define PAINT_TOOL_SMEAR        2
189 #define PAINT_TOOL_CLONE        3
190
191 /* direction that the brush displaces along */
192 enum {
193         SCULPT_DISP_DIR_AREA,
194         SCULPT_DISP_DIR_VIEW,
195         SCULPT_DISP_DIR_X,
196         SCULPT_DISP_DIR_Y,
197         SCULPT_DISP_DIR_Z,
198 };
199
200 #define MAX_BRUSH_PIXEL_RADIUS 200
201
202 #endif
203