Blender  V3.3
DNA_material_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID.h"
11 #include "DNA_defs.h"
12 #include "DNA_listBase.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #ifndef MAX_MTEX
19 # define MAX_MTEX 18
20 #endif
21 
22 struct AnimData;
23 struct Image;
24 struct Ipo;
25 struct bNodeTree;
26 
27 /* WATCH IT: change type? also make changes in ipo.h */
28 
29 typedef struct TexPaintSlot {
31 
32 
33  struct Image *ima;
35 
37  char *uvname;
44  int valid;
46  int interp;
48 
49 typedef struct MaterialGPencilStyle {
51 
52 
53  struct Image *sima;
55  struct Image *ima;
57  float stroke_rgba[4];
59  float fill_rgba[4];
61  float mix_rgba[4];
63  short flag;
65  short index;
67  short stroke_style;
69  short fill_style;
71  float mix_factor;
73  float gradient_angle DNA_DEPRECATED;
75  float gradient_radius DNA_DEPRECATED;
76  char _pad2[4];
78  float gradient_scale[2] DNA_DEPRECATED;
80  float gradient_shift[2] DNA_DEPRECATED;
82  float texture_angle;
84  float texture_scale[2];
86  float texture_offset[2];
88  float texture_opacity DNA_DEPRECATED;
90  float texture_pixsize;
92  int mode;
93 
95  int gradient_type;
96 
98  float mix_stroke_factor;
100  int alignment_mode;
102  float alignment_rotation;
104 
105 /* MaterialGPencilStyle->flag */
107  /* Fill Texture is a pattern */
109  /* don't display color */
110  GP_MATERIAL_HIDE = (1 << 1),
111  /* protected from further editing */
112  GP_MATERIAL_LOCKED = (1 << 2),
113  /* do onion skinning */
115  /* clamp texture */
117  /* mix fill texture */
119  /* Flip fill colors */
121  /* Stroke Texture is a pattern */
123  /* Stroke show main switch */
125  /* Fill show main switch */
127  /* mix stroke texture */
129  /* disable stencil clipping (overlap) */
131  /* Material used as stroke masking. */
133  /* Material used as fill masking. */
136 
142 
143 typedef struct MaterialLineArt {
144  /* eMaterialLineArtFlags */
145  int flags;
146 
147  /* Used to filter line art occlusion edges */
148  unsigned char material_mask_bits;
149 
151  unsigned char mat_occlusion;
152 
153  unsigned char intersection_priority;
154 
155  char _pad;
157 
158 typedef enum eMaterialLineArtFlags {
163 
164 typedef struct Material {
166 
167  ID id;
169  struct AnimData *adt;
170 
171  short flag;
172  char _pad1[2];
173 
174  /* Colors from Blender Internal that we are still using. */
175  float r, g, b, a;
176  float specr, specg, specb;
177  float alpha DNA_DEPRECATED;
178  float ray_mirror DNA_DEPRECATED;
179  float spec;
181  float gloss_mir DNA_DEPRECATED;
182  float roughness;
183  float metallic;
184 
186  char use_nodes;
187 
189  char pr_type;
190  short pr_texture;
191  short pr_flag;
192 
194  short index;
195 
196  struct bNodeTree *nodetree;
198  struct Ipo *ipo DNA_DEPRECATED;
200 
201  /* Freestyle line settings. */
202  float line_col[4];
203  short line_priority;
204  short vcol_alpha;
205 
206  /* Texture painting slots. */
207  short paint_active_slot;
208  short paint_clone_slot;
209  short tot_slots;
210  char _pad2[2];
211 
212  /* Transparency. */
213  float alpha_threshold;
214  float refract_depth;
215  char blend_method;
216  char blend_shadow;
217  char blend_flag;
218  char _pad3[1];
219 
224  struct TexPaintSlot *texpaintslot;
225 
227  ListBase gpumaterial;
228 
230  struct MaterialGPencilStyle *gp_style;
231  struct MaterialLineArt lineart;
233 
234 /* **************** MATERIAL ********************* */
235 
236 /* maximum number of materials per material array.
237  * (on object, mesh, light, etc.). limited by
238  * short mat_nr in verts, faces.
239  * -1 because for active material we store the index + 1 */
240 #define MAXMAT (32767 - 1)
241 
242 /* flag */
243 /* for render */
244 /* #define MA_IS_USED (1 << 0) */ /* UNUSED */
245  /* for dopesheet */
246 #define MA_DS_EXPAND (1 << 1)
247 /* for dopesheet (texture stack expander)
248  * NOTE: this must have the same value as other texture stacks,
249  * otherwise anim-editors will not read correctly
250  */
251 #define MA_DS_SHOW_TEXS (1 << 2)
252 
253 /* ramps */
254 #define MA_RAMP_BLEND 0
255 #define MA_RAMP_ADD 1
256 #define MA_RAMP_MULT 2
257 #define MA_RAMP_SUB 3
258 #define MA_RAMP_SCREEN 4
259 #define MA_RAMP_DIV 5
260 #define MA_RAMP_DIFF 6
261 #define MA_RAMP_DARK 7
262 #define MA_RAMP_LIGHT 8
263 #define MA_RAMP_OVERLAY 9
264 #define MA_RAMP_DODGE 10
265 #define MA_RAMP_BURN 11
266 #define MA_RAMP_HUE 12
267 #define MA_RAMP_SAT 13
268 #define MA_RAMP_VAL 14
269 #define MA_RAMP_COLOR 15
270 #define MA_RAMP_SOFT 16
271 #define MA_RAMP_LINEAR 17
272 
273 /* texco */
274 #define TEXCO_ORCO (1 << 0)
275 /* #define TEXCO_REFL (1 << 1) */ /* deprecated */
276 /* #define TEXCO_NORM (1 << 2) */ /* deprecated */
277 #define TEXCO_GLOB (1 << 3)
278 #define TEXCO_UV (1 << 4)
279 #define TEXCO_OBJECT (1 << 5)
280 /* #define TEXCO_LAVECTOR (1 << 6) */ /* deprecated */
281 /* #define TEXCO_VIEW (1 << 7) */ /* deprecated */
282 /* #define TEXCO_STICKY (1 << 8) */ /* deprecated */
283 /* #define TEXCO_OSA (1 << 9) */ /* deprecated */
284 #define TEXCO_WINDOW (1 << 10)
285 /* #define NEED_UV (1 << 11) */ /* deprecated */
286 /* #define TEXCO_TANGENT (1 << 12) */ /* deprecated */
287 /* still stored in vertex->accum, 1 D */
288 #define TEXCO_STRAND (1 << 13)
290 #define TEXCO_PARTICLE (1 << 13)
291 /* #define TEXCO_STRESS (1 << 14) */ /* deprecated */
292 /* #define TEXCO_SPEED (1 << 15) */ /* deprecated */
293 
295 #define MAP_COL (1 << 0)
296 #define MAP_ALPHA (1 << 7)
297 
298 /* pr_type */
299 typedef enum ePreviewType {
300  MA_FLAT = 0,
302  MA_CUBE = 2,
304  MA_SPHERE_A = 4, /* Used for icon renders only. */
306  MA_LAMP = 6,
307  MA_SKY = 7,
308  MA_HAIR = 10,
309  MA_ATMOS = 11,
310  MA_CLOTH = 12,
311  MA_FLUID = 13,
313 
314 /* pr_flag */
315 #define MA_PREVIEW_WORLD (1 << 0)
316 
317 /* blend_method */
318 enum {
320  // MA_BM_ADD = 1, /* deprecated */
321  // MA_BM_MULTIPLY = 2, /* deprecated */
325 };
326 
327 /* blend_flag */
328 enum {
332  MA_BL_TRANSLUCENCY = (1 << 3),
333 };
334 
335 /* blend_shadow */
336 enum {
341 };
342 
343 /* Grease Pencil Stroke styles */
344 enum {
347 };
348 
349 /* Grease Pencil Fill styles */
350 enum {
353  GP_MATERIAL_FILL_STYLE_CHECKER = 2, /* DEPRECATED (only for convert old files) */
355 };
356 
357 /* Grease Pencil Gradient Types */
358 enum {
361 };
362 
363 /* Grease Pencil Follow Drawing Modes */
364 enum {
368 };
369 
370 #ifdef __cplusplus
371 }
372 #endif
ID and Library types, which are fundamental for sdna.
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition: DNA_defs.h:64
#define DNA_DEPRECATED
Definition: DNA_defs.h:21
These structs are the foundation for all linked lists in the library system.
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_GRADIENT_LINEAR
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_CHECKER
@ GP_MATERIAL_FILL_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
ePreviewType
@ MA_SPHERE_A
@ MA_FLUID
@ MA_CLOTH
@ MA_SHADERBALL
@ MA_FLAT
@ MA_LAMP
@ MA_TEXTURE
@ MA_SKY
@ MA_CUBE
@ MA_ATMOS
@ MA_SPHERE
@ MA_HAIR
@ MA_BS_HASHED
@ MA_BS_CLIP
@ MA_BS_NONE
@ MA_BS_SOLID
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_CUSTOM_OCCLUSION_EFFECTIVENESS
@ LRT_MATERIAL_CUSTOM_INTERSECTION_PRIORITY
@ LRT_MATERIAL_MASK_ENABLED
eMaterialGPencilStyle_Mode
@ GP_MATERIAL_MODE_SQUARE
@ GP_MATERIAL_MODE_DOT
@ GP_MATERIAL_MODE_LINE
@ GP_MATERIAL_FOLLOW_OBJ
@ GP_MATERIAL_FOLLOW_PATH
@ GP_MATERIAL_FOLLOW_FIXED
@ MA_BM_CLIP
@ MA_BM_HASHED
@ MA_BM_SOLID
@ MA_BM_BLEND
struct MaterialLineArt MaterialLineArt
@ MA_BL_CULL_BACKFACE
@ MA_BL_TRANSLUCENCY
@ MA_BL_SS_REFRACTION
@ MA_BL_HIDE_BACKFACE
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue Hue Saturation Apply a color transformation in the HSV color model Specular Similar to the Principled BSDF node but uses the specular workflow instead of metallic
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken roughness("roughness", pxr::TfToken::Immortal)
static const pxr::TfToken preview("preview", pxr::TfToken::Immortal)
Definition: DNA_ID.h:368
unsigned char mat_occlusion
unsigned char intersection_priority
unsigned char material_mask_bits
struct Image * ima
struct ImageUser * image_user