Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DNA_brush_types.h « makesdna « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a87089fbba3ad607bf6efcf4dfc9019cecd423d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/**
 * $Id$
 *
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * 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
 * of the License, or (at your option) any later version. 
 *
 * 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,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2005 Blender Foundation.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): none yet.
 *
 * ***** END GPL LICENSE BLOCK *****
 */

#ifndef DNA_BRUSH_TYPES_H
#define DNA_BRUSH_TYPES_H

#include "DNA_ID.h"
#include "DNA_texture_types.h"

//#ifndef MAX_MTEX // XXX Not used?
//#define MAX_MTEX	18
//#endif

struct CurveMapping;
struct MTex;
struct Image;

typedef struct BrushClone {
	struct Image *image;		/* image for clone tool */
	float offset[2];		/* offset of clone image from canvas */
	float alpha, pad;		/* transparency for drawing of clone image */
} BrushClone;

typedef struct Brush {
	ID id;

	struct BrushClone clone;
	struct CurveMapping *curve;	/* falloff curve */
	struct MTex mtex;

	struct ImBuf *icon_imbuf;
	char icon;
	char pad2[7];
	PreviewImage *preview;
	char icon_filepath[240];

	float normal_weight;

	short blend, pad;		/* blend mode */
	int size;			/* brush diameter */
	int flag;			/* general purpose flag */	
	float jitter;			/* jitter the position of the brush */
	int spacing;			/* spacing of paint operations */
	int smooth_stroke_radius;	/* turning radius (in pixels) for smooth stroke */
	float smooth_stroke_factor;	/* higher values limit fast changes in the stroke direction */
	float rate;			/* paint operations / second (airbrush) */

	float rgb[3];			/* color */
	float alpha;			/* opacity */

	int sculpt_plane;		/* the direction of movement for sculpt vertices */

	float plane_offset;		/* offset for plane brushes (clay, flatten, fill, scrape) */

	char sculpt_tool;		/* active sculpt tool */
	char vertexpaint_tool;		/* active vertex/weight paint tool/blend mode */
	char imagepaint_tool;		/* active image paint tool */
	char pad3;

	float autosmooth_factor;

	float crease_pinch_factor;

	float plane_trim;

	float texture_sample_bias;
	int   texture_overlay_alpha;

	float unprojected_radius;

	float add_col[3];
	float sub_col[3];
} Brush;

/* Brush.flag */
#define BRUSH_AIRBRUSH		(1<<0)
#define BRUSH_TORUS		(1<<1)
#define BRUSH_ALPHA_PRESSURE	(1<<2)
#define BRUSH_SIZE_PRESSURE	(1<<3)
#define BRUSH_JITTER_PRESSURE	(1<<4) /* was BRUSH_RAD_PRESSURE */
#define BRUSH_SPACING_PRESSURE	(1<<5)
#define BRUSH_FIXED_TEX		(1<<6)
#define BRUSH_RAKE		(1<<7)
#define BRUSH_ANCHORED		(1<<8)
#define BRUSH_DIR_IN		(1<<9)
#define BRUSH_SPACE		(1<<10)
#define BRUSH_SMOOTH_STROKE	(1<<11)
#define BRUSH_PERSISTENT	(1<<12)
#define BRUSH_ACCUMULATE	(1<<13)
#define BRUSH_LOCK_ALPHA	(1<<14)
#define BRUSH_ORIGINAL_NORMAL	(1<<15)
#define BRUSH_OFFSET_PRESSURE	(1<<16)
#define BRUSH_SPACE_ATTEN	(1<<18)
#define BRUSH_ADAPTIVE_SPACE	(1<<19)
#define BRUSH_LOCK_SIZE		(1<<20)
#define BRUSH_TEXTURE_OVERLAY	(1<<21)
#define BRUSH_EDGE_TO_EDGE	(1<<22)
#define BRUSH_RESTORE_MESH	(1<<23)
#define BRUSH_INVERSE_SMOOTH_PRESSURE (1<<24)
#define BRUSH_RANDOM_ROTATION (1<<25)
#define BRUSH_PLANE_TRIM (1<<26)
#define BRUSH_FRONTFACE (1<<27)

/* Brush.sculpt_tool */
typedef enum {
	SCULPT_TOOL_DRAW = 1,
	SCULPT_TOOL_SMOOTH,
	SCULPT_TOOL_PINCH,
	SCULPT_TOOL_INFLATE,
	SCULPT_TOOL_GRAB,
	SCULPT_TOOL_LAYER,
	SCULPT_TOOL_FLATTEN,
	SCULPT_TOOL_CLAY,
	SCULPT_TOOL_FILL,
	SCULPT_TOOL_SCRAPE,
	SCULPT_TOOL_NUDGE,
	SCULPT_TOOL_THUMB,
	SCULPT_TOOL_SNAKE_HOOK,
	SCULPT_TOOL_ROTATE,
	//SCULPT_TOOL_WAX        // XXX: reuse this slot later
	SCULPT_TOOL_CREASE,
	SCULPT_TOOL_BLOB,
	SCULPT_TOOL_CLAY_TUBES,
	SCULPT_TOOL_MASK
} SculptTool;

/* Brush.vertexpaint_tool */
#define VERTEX_PAINT_BLUR -1
/* The other vpaint tools are in IMB_BlendMode */

/* Internal Icons */
#define BRUSH_ICON_FILE        0

#define BRUSH_ICON_BLOB        1
#define BRUSH_ICON_CLAY        2
#define BRUSH_ICON_CREASE      3
#define BRUSH_ICON_SCULPTDRAW        4
#define BRUSH_ICON_FILL        5
#define BRUSH_ICON_FLATTEN     6
#define BRUSH_ICON_GRAB        7
#define BRUSH_ICON_INFLATE     8
#define BRUSH_ICON_LAYER       9
#define BRUSH_ICON_NUDGE      10
#define BRUSH_ICON_PINCH      11
#define BRUSH_ICON_SCRAPE     12
#define BRUSH_ICON_SMOOTH     13
#define BRUSH_ICON_SNAKE_HOOK 14
#define BRUSH_ICON_THUMB      15
#define BRUSH_ICON_TWIST      16

#define BRUSH_ICON_ADD        17
#define BRUSH_ICON_BLUR       18
#define BRUSH_ICON_CLONE      19
#define BRUSH_ICON_DARKEN     20
#define BRUSH_ICON_LIGHTEN    21
#define BRUSH_ICON_MIX        22
#define BRUSH_ICON_MULTIPLY   23
#define BRUSH_ICON_SMEAR      24
#define BRUSH_ICON_SOFTEN     25
#define BRUSH_ICON_SUBTRACT   26
#define BRUSH_ICON_TEXDRAW    27
#define BRUSH_ICON_VERTEXDRAW 28

#define BRUSH_ICON_COUNT      29

/* ImagePaintSettings.tool */
#define PAINT_TOOL_DRAW		0
#define PAINT_TOOL_SOFTEN	1
#define PAINT_TOOL_SMEAR	2
#define PAINT_TOOL_CLONE	3

/* direction that the brush displaces along */
enum {
	SCULPT_DISP_DIR_AREA,
	SCULPT_DISP_DIR_VIEW,
	SCULPT_DISP_DIR_X,
	SCULPT_DISP_DIR_Y,
	SCULPT_DISP_DIR_Z,
};

#define MAX_BRUSH_PIXEL_RADIUS 200

#endif