Blender  V3.3
DNA_meshdata_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_customdata_types.h"
11 #include "DNA_listBase.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /* -------------------------------------------------------------------- */
26 typedef struct MVert {
27  float co[3];
28  char flag, bweight;
29  char _pad[2];
31 
33 enum {
34  /* SELECT = (1 << 0), */
35  ME_HIDE = (1 << 4),
36 };
37 
43 typedef struct MEdge {
45  unsigned int v1, v2;
46  char crease, bweight;
47  short flag;
49 
51 enum {
52  /* SELECT = (1 << 0), */
53  ME_EDGEDRAW = (1 << 1),
54  ME_SEAM = (1 << 2),
55  /* ME_HIDE = (1 << 4), */
56  ME_EDGERENDER = (1 << 5),
57  ME_LOOSEEDGE = (1 << 7),
58  ME_EDGE_TMP_TAG = (1 << 8),
59  ME_SHARP = (1 << 9), /* only reason this flag remains a 'short' */
60 };
61 
68 typedef struct MPoly {
70  int loopstart;
72  int totloop;
73  short mat_nr;
74  char flag, _pad;
76 
78 enum {
79  ME_SMOOTH = (1 << 0),
80  ME_FACE_SEL = (1 << 1),
81  /* ME_HIDE = (1 << 4), */
82 };
83 
90 typedef struct MLoop {
92  unsigned int v;
94  unsigned int e;
96 
99 /* -------------------------------------------------------------------- */
109 typedef struct MSelect {
111  int index;
113  int type;
115 
117 enum {
118  ME_VSEL = 0,
119  ME_ESEL = 1,
120  ME_FSEL = 2,
121 };
122 
125 /* -------------------------------------------------------------------- */
220 typedef struct MLoopTri {
221  unsigned int tri[3];
222  unsigned int poly;
224 #
225 #
226 typedef struct MVertTri {
227  unsigned int tri[3];
229 
232 /* -------------------------------------------------------------------- */
237 typedef struct MFloatProperty {
238  float f;
240 typedef struct MIntProperty {
241  int i;
243 typedef struct MStringProperty {
244  char s[255], s_len;
246 typedef struct MBoolProperty {
249 typedef struct MInt8Property {
252 
255 /* -------------------------------------------------------------------- */
262 typedef struct MDeformWeight {
264  unsigned int def_nr;
266  float weight;
268 
272 typedef struct MDeformVert {
279  struct MDeformWeight *dw;
287  int flag;
289 
290 typedef struct MVertSkin {
295  float radius[3];
296 
298  int flag;
300 
301 typedef enum eMVertSkinFlag {
306 
312 
315 /* -------------------------------------------------------------------- */
322 typedef struct MLoopUV {
323  float uv[2];
324  int flag;
326 
328 enum {
329  MLOOPUV_EDGESEL = (1 << 0),
330  MLOOPUV_VERTSEL = (1 << 1),
331  MLOOPUV_PINNED = (1 << 2),
332 };
333 
338 typedef struct MLoopCol {
339  unsigned char r, g, b, a;
341 
342 typedef struct MPropCol {
343  float color[4];
345 
347 typedef struct MDisps {
348  /* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */
349  int totdisp;
350  int level;
351  float (*disps)[3];
352 
359  unsigned int *hidden;
361 
363 typedef struct GridPaintMask {
368  float *data;
369 
371  unsigned int level;
372 
373  char _pad[4];
375 
378 /* -------------------------------------------------------------------- */
389 #
390 #
391 typedef struct OrigSpaceFace {
392  float uv[4][2];
394 
395 #
396 #
397 typedef struct OrigSpaceLoop {
398  float uv[2];
400 
403 /* -------------------------------------------------------------------- */
407 typedef struct FreestyleEdge {
408  char flag;
410 
412 enum {
414 };
415 
416 typedef struct FreestyleFace {
417  char flag;
419 
421 enum {
423 };
424 
427 /* -------------------------------------------------------------------- */
431 #define ME_POLY_LOOP_PREV(mloop, mp, i) \
432  (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])
433 #define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)])
434 
436 #define ME_POLY_TRI_TOT(mp) ((mp)->totloop - 2)
437 
443 #define ME_MAT_NR_TEST(mat_nr, totmat) \
444  (CHECK_TYPE_ANY(mat_nr, short, const short), \
445  CHECK_TYPE_ANY(totmat, short, const short), \
446  (LIKELY(mat_nr < totmat) ? mat_nr : 0))
447 
450 /* -------------------------------------------------------------------- */
458 typedef struct MFace {
459  unsigned int v1, v2, v3, v4;
460  short mat_nr;
462  char edcode, flag;
464 
466 enum {
467  ME_V1V2 = (1 << 0),
468  ME_V2V3 = (1 << 1),
469  ME_V3V1 = (1 << 2),
471  ME_V4V1 = (1 << 3),
472 };
473 
475 typedef struct MTFace {
476  float uv[4][2];
478 
484 typedef struct MCol {
485  unsigned char a, r, g, b;
487 
488 #define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \
489  { \
490  MLoopCol *mloopcol__tmp = _mloopcol; \
491  const MCol *mcol__tmp = _mcol; \
492  mloopcol__tmp->r = mcol__tmp->b; \
493  mloopcol__tmp->g = mcol__tmp->g; \
494  mloopcol__tmp->b = mcol__tmp->r; \
495  mloopcol__tmp->a = mcol__tmp->a; \
496  } \
497  (void)0
498 
499 #define MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) \
500  { \
501  const MLoopCol *mloopcol__tmp = _mloopcol; \
502  MCol *mcol__tmp = _mcol; \
503  mcol__tmp->b = mloopcol__tmp->r; \
504  mcol__tmp->g = mloopcol__tmp->g; \
505  mcol__tmp->r = mloopcol__tmp->b; \
506  mcol__tmp->a = mloopcol__tmp->a; \
507  } \
508  (void)0
509 
511 typedef struct MRecast {
512  int i;
514 
517 #ifdef __cplusplus
518 }
519 #endif
typedef float(TangentPoint)[2]
These structs are the foundation for all linked lists in the library system.
struct MLoop MLoop
struct FreestyleEdge FreestyleEdge
struct MBoolProperty MBoolProperty
struct MDisps MDisps
struct MEdge MEdge
struct MVertTri MVertTri
@ ME_VSEL
@ ME_FSEL
@ ME_ESEL
struct MVertSkin MVertSkin
struct MStringProperty MStringProperty
@ ME_HIDE
struct MLoopTri MLoopTri
@ FREESTYLE_EDGE_MARK
struct GridPaintMask GridPaintMask
struct MRecast MRecast
struct MCol MCol
@ ME_SMOOTH
@ ME_FACE_SEL
struct MDeformVert MDeformVert
struct MTFace MTFace
struct OrigSpaceFace OrigSpaceFace
struct MDeformWeight MDeformWeight
struct OrigSpaceLoop OrigSpaceLoop
@ ME_V4V1
@ ME_V2V3
@ ME_V1V2
@ ME_V3V4
@ ME_V3V1
struct MInt8Property MInt8Property
struct MIntProperty MIntProperty
eMVertSkinFlag
@ MVERT_SKIN_LOOSE
@ MVERT_SKIN_ROOT
struct MLoopCol MLoopCol
struct MPoly MPoly
@ MLOOPUV_PINNED
@ MLOOPUV_VERTSEL
@ MLOOPUV_EDGESEL
struct MFloatProperty MFloatProperty
@ FREESTYLE_FACE_MARK
struct MPropCol MPropCol
struct MFace MFace
@ ME_EDGEDRAW
@ ME_SEAM
@ ME_EDGERENDER
@ ME_EDGE_TMP_TAG
@ ME_LOOSEEDGE
@ ME_SHARP
struct MSelect MSelect
struct MLoopUV MLoopUV
struct FreestyleFace FreestyleFace
struct MVert MVert
unsigned char uint8_t
Definition: stdint.h:78
signed char int8_t
Definition: stdint.h:75
unsigned int level
unsigned char r
unsigned char a
unsigned char g
unsigned char b
struct MDeformWeight * dw
unsigned int def_nr
float(* disps)[3]
unsigned int * hidden
unsigned int v1
unsigned int v2
unsigned int v2
unsigned int v1
unsigned int v4
unsigned int v3
unsigned char a
unsigned char b
unsigned char r
unsigned char g
unsigned int poly
unsigned int tri[3]
unsigned int e
unsigned int v
short mat_nr
float color[4]
float uv[4][2]
unsigned int tri[3]
char _pad[2]
float co[3]