Blender  V2.93
DNA_material_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_ID.h"
27 #include "DNA_defs.h"
28 #include "DNA_listBase.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #ifndef MAX_MTEX
35 # define MAX_MTEX 18
36 #endif
37 
38 struct AnimData;
39 struct Image;
40 struct Ipo;
41 struct bNodeTree;
42 
43 /* WATCH IT: change type? also make changes in ipo.h */
44 
45 typedef struct TexPaintSlot {
47  struct Image *ima;
49  char *uvname;
51  int valid;
53  int interp;
55 
56 typedef struct MaterialGPencilStyle {
58  struct Image *sima;
60  struct Image *ima;
62  float stroke_rgba[4];
64  float fill_rgba[4];
66  float mix_rgba[4];
68  short flag;
70  short index;
72  short stroke_style;
74  short fill_style;
76  float mix_factor;
78  float gradient_angle DNA_DEPRECATED;
80  float gradient_radius DNA_DEPRECATED;
81  char _pad2[4];
83  float gradient_scale[2] DNA_DEPRECATED;
85  float gradient_shift[2] DNA_DEPRECATED;
89  float texture_scale[2];
91  float texture_offset[2];
93  float texture_opacity DNA_DEPRECATED;
97  int mode;
98 
101 
109 
110 /* MaterialGPencilStyle->flag */
112  /* Fill Texture is a pattern */
114  /* don't display color */
115  GP_MATERIAL_HIDE = (1 << 1),
116  /* protected from further editing */
117  GP_MATERIAL_LOCKED = (1 << 2),
118  /* do onion skinning */
120  /* clamp texture */
122  /* mix fill texture */
124  /* Flip fill colors */
126  /* Stroke Texture is a pattern */
128  /* Stroke show main switch */
130  /* Fill show main switch */
132  /* mix stroke texture */
134  /* disable stencil clipping (overlap) */
136  /* Material used as stroke masking. */
138  /* Material used as fill masking. */
141 
147 
148 typedef struct MaterialLineArt {
149  int flags; /* eMaterialLineArtFlags */
150  unsigned char transparency_mask;
151  unsigned char _pad[3];
153 
154 typedef enum eMaterialLineArtFlags {
157 
158 typedef struct Material {
161  struct AnimData *adt;
162 
163  short flag;
164  char _pad1[2];
165 
166  /* Colors from Blender Internal that we are still using. */
167  float r, g, b, a;
168  float specr, specg, specb;
170  float ray_mirror DNA_DEPRECATED;
171  float spec;
173  float gloss_mir DNA_DEPRECATED;
174  float roughness;
175  float metallic;
176 
178  char use_nodes;
179 
181  char pr_type;
182  short pr_texture;
183  short pr_flag;
184 
186  short index;
187 
190  struct Ipo *ipo DNA_DEPRECATED;
192 
193  /* Freestyle line settings. */
194  float line_col[4];
196  short vcol_alpha;
197 
198  /* Texture painting slots. */
201  short tot_slots;
202  char _pad2[2];
203 
204  /* Transparency. */
210  char _pad3[1];
211 
217 
220 
223  struct MaterialLineArt lineart;
225 
226 /* **************** MATERIAL ********************* */
227 
228 /* maximum number of materials per material array.
229  * (on object, mesh, light, etc.). limited by
230  * short mat_nr in verts, faces.
231  * -1 because for active material we store the index + 1 */
232 #define MAXMAT (32767 - 1)
233 
234 /* flag */
235 /* for render */
236 /* #define MA_IS_USED (1 << 0) */ /* UNUSED */
237  /* for dopesheet */
238 #define MA_DS_EXPAND (1 << 1)
239 /* for dopesheet (texture stack expander)
240  * NOTE: this must have the same value as other texture stacks,
241  * otherwise anim-editors will not read correctly
242  */
243 #define MA_DS_SHOW_TEXS (1 << 2)
244 
245 /* ramps */
246 #define MA_RAMP_BLEND 0
247 #define MA_RAMP_ADD 1
248 #define MA_RAMP_MULT 2
249 #define MA_RAMP_SUB 3
250 #define MA_RAMP_SCREEN 4
251 #define MA_RAMP_DIV 5
252 #define MA_RAMP_DIFF 6
253 #define MA_RAMP_DARK 7
254 #define MA_RAMP_LIGHT 8
255 #define MA_RAMP_OVERLAY 9
256 #define MA_RAMP_DODGE 10
257 #define MA_RAMP_BURN 11
258 #define MA_RAMP_HUE 12
259 #define MA_RAMP_SAT 13
260 #define MA_RAMP_VAL 14
261 #define MA_RAMP_COLOR 15
262 #define MA_RAMP_SOFT 16
263 #define MA_RAMP_LINEAR 17
264 
265 /* texco */
266 #define TEXCO_ORCO (1 << 0)
267 /* #define TEXCO_REFL (1 << 1) */ /* deprecated */
268 /* #define TEXCO_NORM (1 << 2) */ /* deprecated */
269 #define TEXCO_GLOB (1 << 3)
270 #define TEXCO_UV (1 << 4)
271 #define TEXCO_OBJECT (1 << 5)
272 /* #define TEXCO_LAVECTOR (1 << 6) */ /* deprecated */
273 /* #define TEXCO_VIEW (1 << 7) */ /* deprecated */
274 /* #define TEXCO_STICKY (1 << 8) */ /* deprecated */
275 /* #define TEXCO_OSA (1 << 9) */ /* deprecated */
276 #define TEXCO_WINDOW (1 << 10)
277 /* #define NEED_UV (1 << 11) */ /* deprecated */
278 /* #define TEXCO_TANGENT (1 << 12) */ /* deprecated */
279 /* still stored in vertex->accum, 1 D */
280 #define TEXCO_STRAND (1 << 13)
282 #define TEXCO_PARTICLE (1 << 13)
283 /* #define TEXCO_STRESS (1 << 14) */ /* deprecated */
284 /* #define TEXCO_SPEED (1 << 15) */ /* deprecated */
285 
286 /* mapto */
287 #define MAP_COL (1 << 0)
288 #define MAP_ALPHA (1 << 7)
289 
290 /* pmapto */
291 /* init */
292 #define MAP_PA_INIT ((1 << 5) - 1)
293 #define MAP_PA_TIME (1 << 0)
294 #define MAP_PA_LIFE (1 << 1)
295 #define MAP_PA_DENS (1 << 2)
296 #define MAP_PA_SIZE (1 << 3)
297 #define MAP_PA_LENGTH (1 << 4)
298 /* reset */
299 #define MAP_PA_IVEL (1 << 5)
300 /* physics */
301 #define MAP_PA_PVEL (1 << 6)
302 /* path cache */
303 #define MAP_PA_CLUMP (1 << 7)
304 #define MAP_PA_KINK (1 << 8)
305 #define MAP_PA_ROUGH (1 << 9)
306 #define MAP_PA_FREQ (1 << 10)
307 
308 /* pr_type */
309 #define MA_FLAT 0
310 #define MA_SPHERE 1
311 #define MA_CUBE 2
312 #define MA_SHADERBALL 3
313 #define MA_SPHERE_A 4 /* Used for icon renders only. */
314 #define MA_TEXTURE 5
315 #define MA_LAMP 6
316 #define MA_SKY 7
317 #define MA_HAIR 10
318 #define MA_ATMOS 11
319 #define MA_CLOTH 12
320 #define MA_FLUID 13
321 
322 /* pr_flag */
323 #define MA_PREVIEW_WORLD (1 << 0)
324 
325 /* blend_method */
326 enum {
328  // MA_BM_ADD = 1, /* deprecated */
329  // MA_BM_MULTIPLY = 2, /* deprecated */
333 };
334 
335 /* blend_flag */
336 enum {
340  MA_BL_TRANSLUCENCY = (1 << 3),
341 };
342 
343 /* blend_shadow */
344 enum {
349 };
350 
351 /* Grease Pencil Stroke styles */
352 enum {
355 };
356 
357 /* Grease Pencil Fill styles */
358 enum {
361  GP_MATERIAL_FILL_STYLE_CHECKER = 2, /* DEPRECATED (only for convert old files) */
363 };
364 
365 /* Grease Pencil Gradient Types */
366 enum {
369 };
370 
371 /* Grease Pencil Follow Drawing Modes */
372 enum {
376 };
377 
378 #ifdef __cplusplus
379 }
380 #endif
ID and Library types, which are fundamental for sdna.
These structs are the foundation for all linked lists in the library system.
@ MA_BL_CULL_BACKFACE
@ MA_BL_TRANSLUCENCY
@ MA_BL_SS_REFRACTION
@ MA_BL_HIDE_BACKFACE
struct TexPaintSlot TexPaintSlot
@ GP_MATERIAL_FOLLOW_OBJ
@ GP_MATERIAL_FOLLOW_PATH
@ GP_MATERIAL_FOLLOW_FIXED
struct MaterialGPencilStyle MaterialGPencilStyle
struct Material Material
eMaterialGPencilStyle_Flag
@ GP_MATERIAL_LOCKED
@ GP_MATERIAL_FLIP_FILL
@ GP_MATERIAL_STROKE_PATTERN
@ GP_MATERIAL_STROKE_TEX_MIX
@ GP_MATERIAL_FILL_TEX_MIX
@ GP_MATERIAL_HIDE_ONIONSKIN
@ GP_MATERIAL_HIDE
@ GP_MATERIAL_DISABLE_STENCIL
@ GP_MATERIAL_IS_STROKE_HOLDOUT
@ GP_MATERIAL_STROKE_SHOW
@ GP_MATERIAL_IS_FILL_HOLDOUT
@ GP_MATERIAL_FILL_PATTERN
@ GP_MATERIAL_FILL_SHOW
@ GP_MATERIAL_TEX_CLAMP
eMaterialLineArtFlags
@ LRT_MATERIAL_TRANSPARENCY_ENABLED
eMaterialGPencilStyle_Mode
@ GP_MATERIAL_MODE_SQUARE
@ GP_MATERIAL_MODE_DOT
@ GP_MATERIAL_MODE_LINE
@ MA_BM_CLIP
@ MA_BM_HASHED
@ MA_BM_SOLID
@ MA_BM_BLEND
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_GRADIENT_LINEAR
struct MaterialLineArt MaterialLineArt
@ MA_BS_HASHED
@ MA_BS_CLIP
@ MA_BS_NONE
@ MA_BS_SOLID
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_CHECKER
@ GP_MATERIAL_FILL_STYLE_SOLID
static CCL_NAMESPACE_BEGIN const double alpha
Definition: DNA_ID.h:273
float gradient_radius DNA_DEPRECATED
float gradient_shift[2] DNA_DEPRECATED
float texture_opacity DNA_DEPRECATED
float gradient_angle DNA_DEPRECATED
float gradient_scale[2] DNA_DEPRECATED
unsigned char _pad[3]
unsigned char transparency_mask
float line_col[4]
struct MaterialLineArt lineart
struct bNodeTree * nodetree
short paint_active_slot
struct PreviewImage * preview
struct MaterialGPencilStyle * gp_style
struct Ipo *ipo DNA_DEPRECATED
float alpha DNA_DEPRECATED
float alpha_threshold
ListBase gpumaterial
struct AnimData * adt
float ray_mirror DNA_DEPRECATED
float gloss_mir DNA_DEPRECATED
struct TexPaintSlot * texpaintslot
short paint_clone_slot
struct Image * ima