Blender V5.0
DNA_particle_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 by Janne Karhu. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_ID.h"
12#include "DNA_boid_types.h"
13#include "DNA_defs.h"
14
15struct AnimData;
16
17typedef struct HairKey {
19 float co[3];
21 float time;
23 float weight;
25 short editflag;
26 char _pad[2];
27 float world_co[3];
29
30typedef struct ParticleKey { /* when changed update size of struct to copy_particleKey()!! */
32 float co[3];
34 float vel[3];
36 float rot[4];
38 float ave[3];
40 float time;
42
43typedef struct BoidParticle {
44 struct Object *ground;
45 struct BoidData data;
46 float gravity[3];
47 float wander[3];
48 char _pad0[4];
50
55
57typedef struct ChildParticle {
59 int num;
60 int parent;
62 int pa[4];
64 float w[4];
66 float fuv[4], foffset;
67 char _pad0[4];
69
70typedef struct ParticleTarget {
72 struct Object *ob;
73 int psys;
74 short flag, mode;
75 float time, duration;
77
78typedef struct ParticleDupliWeight {
80 struct Object *ob;
81 short count;
82 short flag;
84 short index;
85 char _pad0[2];
87
88typedef struct ParticleData {
91
94
97
100
103
106
115 float dietime;
116
122 int num;
128
130 float fuv[4], foffset;
131 /* face normal for volume emission. */
132
134 float size;
135
138 char _pad[4];
139
141 short flag;
143 short alive;
145
158
160enum {
168};
169
171enum {
174};
175
176typedef struct ParticleSettings {
177#ifdef __cplusplus
179 static constexpr ID_Type id_type = ID_PA;
180#endif
181
183 struct AnimData *adt;
184
187
190
191 int flag;
192 char _pad1[4];
194 /* physics modes */
196 int draw;
199 char _pad2[4];
201 /* number of path segments, power of 2 except */
204
205 /* adaptive path rendering */
207
209 short rotfrom DNA_DEPRECATED;
211
212 /* billboards */
213 short bb_align, bb_uv_split, bb_anim, bb_split_offset DNA_DEPRECATED;
215
216 /* draw color */
218
219 /* time and emission */
225 char _pad0[6];
226
227 /* initial velocity factors */
229 float ob_vel[3];
231 /* physical properties */
233 /* global physical properties */
235 /* length */
237 /* children */
239 char _pad3[4];
243 /* clumping */
245 /* kink */
249 char _pad4[4];
251 /* rough */
255 /* length */
257 /* parting */
260 /* branching */
262 /* drawing stuff */
263 float draw_line[2];
266 /* keyed particles */
271
272 /* hair dynamics */
274
275 struct MTex *mtex[/*MAX_MTEX*/ 18];
276
279 struct Collection *force_group DNA_DEPRECATED; /* deprecated */
281 struct Object *bb_ob;
284
285 /* Evaluated mesh support. */
287 char _pad5[2];
288
289 /* hair shape */
291 char _pad6[2];
292
293 float twist;
294 char _pad8[4];
295
296 /* hair thickness shape */
297 float shape;
299
302
303typedef struct ParticleSystem {
304 /* note1: make sure all (run-time) are NULL's in `copy_particlesystem` XXX,
305 * this function is no more! - need to investigate. */
306
307 /* note2: make sure any uses of this struct in DNA are
308 * accounted for in #BKE_object_copy_particlesystems. */
309
311
314
319
323 void (*free_edit)(struct PTCacheEdit *edit);
324
331
336
338
341
343 struct Object *parent;
344
347
349 char name[/*MAX_NAME*/ 64];
350
352 float imat[4][4];
356 /* NOTE: Recalc is one of ID_RECALC_PSYS_ALL flags.
357 *
358 * TODO(sergey): Use #ParticleSettings.id.recalc instead of this duplicated flag somehow. */
361 char _pad1[6];
362
364 char bb_uvname[3][/*MAX_CUSTOMDATA_LAYER_NAME*/ 68] DNA_DEPRECATED;
365
366 char _pad2[4];
367 /* if you change these remember to update array lengths to PSYS_TOT_VG! */
369 short vgroup[13], vg_neg, rt3;
370 char _pad3[6];
371
372 /* point cache */
375
377
380
382 struct KDTree_3d *tree;
385
387
389 float dt_frac;
392
394
405
406typedef enum eParticleDrawFlag {
407 PART_DRAW_VEL = (1 << 0),
409 PART_DRAW_SIZE = (1 << 2),
412 PART_DRAW_EMITTER = (1 << 3), /* DEPRECATED */
413#endif
417 /* PART_DRAW_BB_LOCK = (1 << 7), */ /* DEPRECATED */
418 /* used with billboards */ /* DEPRECATED */
419 PART_DRAW_ROTATE_OB = (1 << 7), /* used with instance object/collection */
421 PART_DRAW_NUM = (1 << 9),
422 PART_DRAW_RAND_GR = (1 << 10),
425 PART_DRAW_MAT_COL = (1 << 13), /* deprecated, but used in do_versions */
428 PART_DRAW_NO_SCALE_OB = (1 << 16), /* used with instance object/collection */
432
438enum {
440 /* REACTOR type currently unused */
441 /* PART_REACTOR = 1, */
443 PART_FLUID = 3, /* Deprecated (belonged to ELBEEM). */
453};
454
456enum {
457 /* PARTICLE_TYPE_NONE = (0 << 0), */ /* UNUSED */
458 /* PARTICLE_TYPE_NEW = (1 << 0), */ /* UNUSED */
464 /* PARTICLE_TYPE_INVALID = (1 << 30), */ /* UNUSED */
465};
466
468enum {
471
472 // PART_LOOP = 1 << 2, /* not used anymore */
473
474 /* For dope-sheet. */
476
479
481 PART_UNBORN = 1 << 5,
483 PART_DIED = 1 << 6,
484
485 PART_TRAND = 1 << 7,
487 PART_EDISTR = 1 << 8,
488
494 PART_SIZE_DEFL = 1 << 13,
496 PART_ROT_DYN = 1 << 14,
497
499
500 PART_SIZEMASS = 1 << 16,
501
502 // PART_ABS_TIME = 1 << 17,
503 // PART_GLOB_TIME = 1 << 18,
504
505 PART_BOIDS_2D = 1 << 19,
506
507 // PART_BRANCHING = 1 << 20,
508 // PART_ANIM_BRANCHING = 1 << 21,
510
513
516 // PART_CHILD_RENDER = 1 << 29, /* UNUSED */
518
519};
520
522enum {
526 // PART_FROM_PARTICLE = 3, /* Deprecated. */
528};
529
531enum {
535};
536
538enum {
544};
545
555
563
568
570enum {
575};
576
578enum {
581};
582
584enum {
595 PART_DRAW_BB = 9, /* Deprecated. */
597};
598
600enum {
605};
606
608enum {
618};
619
621enum {
629};
630
632enum {
636};
637
639enum {
642};
643
645enum {
646 PSYS_CURRENT = 1 << 0,
650 // PSYS_ENABLED = 1 << 4, /* Deprecated. */
653 // PSYS_DRAWING = 1 << 6, /* Deprecated. */
654 // PSYS_USE_IMAT = 1 << 7, /* Deprecated. */
656 PSYS_DELETE = 1 << 8,
658 PSYS_KEYED = 1 << 10,
659 PSYS_EDITED = 1 << 11,
660 // PSYS_PROTECT_CACHE = 1 << 12, /* Deprecated. */
661 PSYS_DISABLED = 1 << 13,
665};
666
668enum {
669 PARS_UNEXIST = 1 << 0,
670 PARS_NO_DISP = 1 << 1,
671 // PARS_STICKY = 1 << 2, /* deprecated */
672 PARS_REKEY = 1 << 3,
673};
674
676enum {
677 PARS_KILLED = 0, /* Deprecated. */
682};
683
685enum {
687};
688
690enum {
692};
693
695enum {
709};
710
712enum {
715};
716
718enum {
722};
723
726 /* init */
727 PAMAP_TIME = (1 << 0), /* emission time */
728 PAMAP_LIFE = (1 << 1), /* life time */
729 PAMAP_DENS = (1 << 2), /* density */
730 PAMAP_SIZE = (1 << 3), /* physical size */
732 /* reset */
733 PAMAP_IVEL = (1 << 5), /* initial velocity */
734 /* physics */
735 PAMAP_FIELD = (1 << 6), /* force fields */
736 PAMAP_GRAVITY = (1 << 10),
737 PAMAP_DAMP = (1 << 11),
739 /* children */
740 PAMAP_CLUMP = (1 << 7),
741 PAMAP_KINK_FREQ = (1 << 8),
742 PAMAP_KINK_AMP = (1 << 12),
743 PAMAP_ROUGH = (1 << 9),
744 PAMAP_LENGTH = (1 << 4),
745 PAMAP_TWIST = (1 << 13),
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_PA
eParticleShapeFlag
@ PART_SHAPE_CLOSE_TIP
@ SPH_FAC_DENSITY
@ SPH_CURRENT_REST_LENGTH
@ SPH_FAC_REST_LENGTH
@ SPH_FAC_REPULSION
@ SPH_FAC_VISCOSITY
@ SPH_VISCOELASTIC_SPRINGS
@ SPH_FAC_RADIUS
@ PTARGET_CURRENT
@ PTARGET_VALID
@ PART_EVENT_NEAR
@ PART_EVENT_DEATH
@ PART_EVENT_COLLIDE
@ SPH_SOLVER_DDR
@ SPH_SOLVER_CLASSICAL
@ PSYS_CURRENT
@ PSYS_DISABLED
@ PSYS_HAIR_DYNAMICS
@ PSYS_EDITED
@ PSYS_DELETE
@ PSYS_HAIR_DONE
@ PSYS_GLOBAL_HAIR
@ PSYS_HAIR_UPDATED
@ PSYS_KEYED_TIMING
@ PSYS_OB_ANIM_RESTORE
@ PSYS_SHARED_CACHES
@ PSYS_KEYED
@ PART_DISTR_GRID
@ PART_DISTR_RAND
@ PART_DISTR_JIT
@ PART_UNBORN
@ PART_CHILD_LONG_HAIR
@ PART_REACT_STA_END
@ PART_BOIDS_2D
@ PART_EDISTR
@ PART_SIZEMASS
@ PART_HAIR_REGROW
@ PART_ROT_DYN
@ PART_CHILD_GUIDE
@ PART_DIE_ON_COL
@ PART_CHILD_EFFECT
@ PART_HIDE_ADVANCED_HAIR
@ PART_SIZE_DEFL
@ PART_HAIR_BSPLINE
@ PART_DIED
@ PART_GRID_HEXAGONAL
@ PART_DS_EXPAND
@ PART_GRID_INVERT
@ PART_SELF_EFFECT
@ PART_ROTATIONS
@ PART_REACT_MULTIPLE
@ PART_TRAND
@ PART_TIME_AUTOSF
@ PARS_ALIVE
@ PARS_KILLED
@ PARS_DYING
@ PARS_DEAD
@ PARS_UNBORN
@ PART_DUPLIW_CURRENT
@ PART_AVE_GLOBAL_X
@ PART_AVE_GLOBAL_Z
@ PART_AVE_VERTICAL
@ PART_AVE_VELOCITY
@ PART_AVE_GLOBAL_Y
@ PART_AVE_HORIZONTAL
@ PART_AVE_RAND
@ PART_INT_VERLET
@ PART_INT_MIDPOINT
@ PART_INT_RK4
@ PART_INT_EULER
eParticleDrawFlag
@ PART_DRAW_WHOLE_GR
@ PART_DRAW_REN_STRAND
@ PART_DRAW_SIZE
@ PART_DRAW_VEL
@ PART_DRAW_GLOBAL_OB
@ PART_DRAW_PARENT
@ PART_DRAW_NUM
@ PART_DRAW_NO_SCALE_OB
@ PART_DRAW_COUNT_GR
@ PART_DRAW_MAT_COL
@ PART_DRAW_HAIR_GRID
@ PART_ABS_PATH_TIME
@ PART_DRAW_REN_ADAPT
@ PART_DRAW_HEALTH
@ PART_DRAW_RAND_GR
@ PART_DRAW_VEL_LENGTH
@ PART_DRAW_GUIDE_HAIRS
@ PART_DRAW_ROTATE_OB
@ PART_FLUID_FLIP
@ PART_EMITTER
@ PART_FLUID_BUBBLE
@ PART_FLUID_SPRAYBUBBLE
@ PART_FLUID_TRACER
@ PART_FLUID
@ PART_FLUID_FOAM
@ PART_FLUID_SPRAYFOAMBUBBLE
@ PART_FLUID_SPRAYFOAM
@ PART_HAIR
@ PART_FLUID_SPRAY
@ PART_FLUID_FOAMBUBBLE
@ PSYS_TOT_VG
eParticleTextureInfluence
@ PAMAP_DENS
@ PAMAP_FIELD
@ PAMAP_CHILD
@ PAMAP_KINK_FREQ
@ PAMAP_PHYSICS
@ PAMAP_TWIST
@ PAMAP_DAMP
@ PAMAP_SIZE
@ PAMAP_IVEL
@ PAMAP_INIT
@ PAMAP_GRAVITY
@ PAMAP_LIFE
@ PAMAP_KINK_AMP
@ PAMAP_TIME
@ PAMAP_CLUMP
@ PAMAP_LENGTH
@ PAMAP_ROUGH
@ PART_ROT_VEL
@ PART_ROT_OB_Y
@ PART_ROT_NOR_TAN
@ PART_ROT_OB_Z
@ PART_ROT_GLOB_Y
@ PART_ROT_GLOB_X
@ PART_ROT_NOR
@ PART_ROT_OB_X
@ PART_ROT_GLOB_Z
@ PART_KINK_BRAID
@ PART_KINK_WAVE
@ PART_KINK_SPIRAL
@ PART_KINK_RADIAL
@ PART_KINK_CURL
@ PART_KINK_NO
@ PART_DRAW_COL_NONE
@ PART_DRAW_COL_ACC
@ PART_DRAW_COL_MAT
@ PART_DRAW_COL_VEL
@ PART_DRAW_CIRC
@ PART_DRAW_CROSS
@ PART_DRAW_AXIS
@ PART_DRAW_PATH
@ PART_DRAW_LINE
@ PART_DRAW_NOT
@ PART_DRAW_GR
@ PART_DRAW_BB
@ PART_DRAW_OB
@ PART_DRAW_REND
@ PART_DRAW_HALO
@ PART_DRAW_DOT
@ PARS_REKEY
@ PARS_NO_DISP
@ PARS_UNEXIST
@ PTARGET_MODE_ENEMY
@ PTARGET_MODE_FRIEND
@ PTARGET_MODE_NEUTRAL
@ PART_PHYS_FLUID
@ PART_PHYS_NEWTON
@ PART_PHYS_KEYED
@ PART_PHYS_BOIDS
@ PART_PHYS_NO
@ PART_CHILD_PARTICLES
@ PART_CHILD_FACES
eParticleChildFlag
@ PART_CHILD_USE_TWIST_CURVE
@ PART_CHILD_USE_CLUMP_CURVE
@ PART_CHILD_USE_CLUMP_NOISE
@ PART_CHILD_USE_ROUGH_CURVE
@ PSYS_VG_ROUGHE
@ PSYS_VG_SIZE
@ PSYS_VG_ROT
@ PSYS_VG_LENGTH
@ PSYS_VG_ROUGH1
@ PSYS_VG_DENSITY
@ PSYS_VG_CLUMP
@ PSYS_VG_VEL
@ PSYS_VG_TAN
@ PSYS_VG_KINK
@ PSYS_VG_EFFECTOR
@ PSYS_VG_ROUGH2
@ PSYS_VG_TWIST
@ PART_FROM_VOLUME
@ PART_FROM_CHILD
@ PART_FROM_VERT
@ PART_FROM_FACE
@ PARTICLE_TYPE_BUBBLE
@ PARTICLE_TYPE_DELETE
@ PARTICLE_TYPE_TRACER
@ PARTICLE_TYPE_FOAM
@ PARTICLE_TYPE_SPRAY
struct Object * ground
struct BoidData data
float world_co[3]
Definition DNA_ID.h:414
BoidParticle * boid
ParticleKey state
ParticleKey prev_state
ParticleKey * keys
struct ParticleDupliWeight * prev
struct ParticleDupliWeight * next
struct CurveMapping * clumpcurve
struct PartDeflect * pd2
struct Collection * collision_group
struct Collection * instance_collection
struct AnimData * adt
struct Object * bb_ob
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct BoidSettings * boids
struct EffectorWeights * effector_weights
struct MTex * mtex[18]
struct PartDeflect * pd
struct ListBase instance_weights
short rotfrom DNA_DEPRECATED
struct Object * instance_object
struct SPHFluidSettings * fluid
unsigned int delete_flag
unsigned int particle_index[2]
ParticleSpring * fluid_springs
ChildParticle * child
char bb_uvname[3][68] DNA_DEPRECATED
struct PTCacheEdit * edit
struct ListBase ptcaches
ParticleData * particles
struct ListBase targets
ParticleSettings * part
struct ListBase * effectors
struct ParticleSystem * next
struct PointCache * pointcache
struct BVHTree * bvhtree
struct ClothModifierData * clmd
NODE_DECLARE ParticleSystem()
struct Object * target_ob
struct ParticleSystem * prev
struct LatticeDeformData * lattice_deform_data
struct ParticleCacheKey ** childcache
struct Mesh * hair_in_mesh
struct KDTree_3d * tree
struct Object * parent
struct ParticleSystem * orig_psys
struct Mesh * hair_out_mesh
struct ParticleDrawData * pdd
struct ParticleCacheKey ** pathcache
void(* free_edit)(struct PTCacheEdit *edit)
struct Object * ob
struct ParticleTarget * prev
struct ParticleTarget * next
#define DNA_DEPRECATED_ALLOW
Definition versioning.cc:11