Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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
35 #ifndef MAX_MTEX
36 #define MAX_MTEX        18
37 #endif
38
39 struct CurveMapping;
40 struct MTex;
41 struct Image;
42
43 typedef struct BrushClone {
44         struct Image *image;            /* image for clone tool */
45         float offset[2];                        /* offset of clone image from canvas */
46         float alpha, pad;                       /* transparency for drawing of clone image */
47 } BrushClone;
48
49 typedef struct Brush {
50         ID id;
51
52         struct BrushClone clone;
53
54         struct CurveMapping *curve;     /* falloff curve */
55         struct MTex *mtex[18];          /* MAX_MTEX */
56         
57         short flag, blend;                      /* general purpose flag, blend mode */
58         int size;                                       /* brush diameter */
59         float innerradius;                      /* inner radius after which the falloff starts */
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         short texact;                           /* active texture */
69         char sculpt_tool;                       /* active tool */
70         
71         char pad[1];
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_RAD_PRESSURE              16
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
89 /* Brush.blend */
90 #define BRUSH_BLEND_MIX                 0
91 #define BRUSH_BLEND_ADD                 1
92 #define BRUSH_BLEND_SUB                 2
93 #define BRUSH_BLEND_MUL                 3
94 #define BRUSH_BLEND_LIGHTEN             4
95 #define BRUSH_BLEND_DARKEN              5
96 #define BRUSH_BLEND_ERASE_ALPHA 6
97 #define BRUSH_BLEND_ADD_ALPHA   7
98
99 /* Brush.sculpt_tool */
100 #define SCULPT_TOOL_DRAW    1
101 #define SCULPT_TOOL_SMOOTH  2
102 #define SCULPT_TOOL_PINCH   3
103 #define SCULPT_TOOL_INFLATE 4
104 #define SCULPT_TOOL_GRAB    5
105 #define SCULPT_TOOL_LAYER   6
106 #define SCULPT_TOOL_FLATTEN 7
107 #define SCULPT_TOOL_CLAY    8
108
109 /* ImagePaintSettings.tool */
110 #define PAINT_TOOL_DRAW         0
111 #define PAINT_TOOL_SOFTEN       1
112 #define PAINT_TOOL_SMEAR        2
113 #define PAINT_TOOL_CLONE        3
114
115 #endif
116