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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2016-12-28 19:30:58 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-12-28 19:30:58 +0300
commit6ecab6dd8e48d564a2b43e0e81e79d079e8b4c77 (patch)
tree618e2d24eb34a05a81f726dd52eb2b7468e9296d /source/blender/makesdna
parent605263177b8eea24c1449e4dbf0138175ec3dddf (diff)
Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be91263a249ffae75573e3b32f24269d890 and b4a721af694817fa921b119df83d33ede7d7fed0. Due to postponement of particle system rewrite it was decided to put particle code back into the 2.8 branch for the time being.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_ID.h5
-rw-r--r--source/blender/makesdna/DNA_boid_types.h225
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h3
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h39
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h42
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim.h2
-rw-r--r--source/blender/makesdna/DNA_object_force.h109
-rw-r--r--source/blender/makesdna/DNA_object_types.h7
-rw-r--r--source/blender/makesdna/DNA_outliner_types.h2
-rw-r--r--source/blender/makesdna/DNA_particle_types.h613
-rw-r--r--source/blender/makesdna/DNA_rigidbody_types.h3
-rw-r--r--source/blender/makesdna/DNA_scene_types.h36
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h4
-rw-r--r--source/blender/makesdna/DNA_space_types.h2
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesdna/intern/makesdna.c4
16 files changed, 1090 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index f5c714a7629..ed719b66eb3 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -247,6 +247,7 @@ typedef enum ID_Type {
ID_AC = MAKE_ID2('A', 'C'), /* bAction */
ID_NT = MAKE_ID2('N', 'T'), /* bNodeTree */
ID_BR = MAKE_ID2('B', 'R'), /* Brush */
+ ID_PA = MAKE_ID2('P', 'A'), /* ParticleSettings */
ID_GD = MAKE_ID2('G', 'D'), /* bGPdata, (Grease Pencil) */
ID_WM = MAKE_ID2('W', 'M'), /* WindowManager */
ID_MC = MAKE_ID2('M', 'C'), /* MovieClip */
@@ -385,7 +386,8 @@ enum {
FILTER_ID_TXT = (1 << 24),
FILTER_ID_VF = (1 << 25),
FILTER_ID_WO = (1 << 26),
- FILTER_ID_CF = (1 << 27),
+ FILTER_ID_PA = (1 << 27),
+ FILTER_ID_CF = (1 << 28),
};
/* IMPORTANT: this enum matches the order currently use in set_lisbasepointers,
@@ -415,6 +417,7 @@ enum {
INDEX_ID_PAL,
INDEX_ID_PC,
INDEX_ID_BR,
+ INDEX_ID_PA,
INDEX_ID_SPK,
INDEX_ID_WO,
INDEX_ID_MC,
diff --git a/source/blender/makesdna/DNA_boid_types.h b/source/blender/makesdna/DNA_boid_types.h
new file mode 100644
index 00000000000..f1930ffd643
--- /dev/null
+++ b/source/blender/makesdna/DNA_boid_types.h
@@ -0,0 +1,225 @@
+/*
+ * ***** 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) 2009 by Janne Karhu.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file DNA_boid_types.h
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_BOID_TYPES_H__
+#define __DNA_BOID_TYPES_H__
+
+#include "DNA_listBase.h"
+
+typedef enum BoidRuleType {
+ eBoidRuleType_None = 0,
+ eBoidRuleType_Goal = 1, /* go to goal assigned object or loudest assigned signal source */
+ eBoidRuleType_Avoid = 2, /* get away from assigned object or loudest assigned signal source */
+ eBoidRuleType_AvoidCollision = 3, /* manoeuver to avoid collisions with other boids and deflector object in near future */
+ eBoidRuleType_Separate = 4, /* keep from going through other boids */
+ eBoidRuleType_Flock = 5, /* move to center of neighbors and match their velocity */
+ eBoidRuleType_FollowLeader = 6, /* follow a boid or assigned object */
+ eBoidRuleType_AverageSpeed = 7, /* maintain speed, flight level or wander*/
+ eBoidRuleType_Fight = 8, /* go to closest enemy and attack when in range */
+ //eBoidRuleType_Protect = 9, /* go to enemy closest to target and attack when in range */
+ //eBoidRuleType_Hide = 10, /* find a deflector move to it's other side from closest enemy */
+ //eBoidRuleType_FollowPath = 11, /* move along a assigned curve or closest curve in a group */
+ //eBoidRuleType_FollowWall = 12, /* move next to a deflector object's in direction of it's tangent */
+ NUM_BOID_RULE_TYPES
+} BoidRuleType;
+
+/* boidrule->flag */
+#define BOIDRULE_CURRENT 1
+#define BOIDRULE_IN_AIR 4
+#define BOIDRULE_ON_LAND 8
+typedef struct BoidRule {
+ struct BoidRule *next, *prev;
+ int type, flag;
+ char name[32];
+} BoidRule;
+#define BRULE_GOAL_AVOID_PREDICT 1
+#define BRULE_GOAL_AVOID_ARRIVE 2
+#define BRULE_GOAL_AVOID_SIGNAL 4
+typedef struct BoidRuleGoalAvoid {
+ BoidRule rule;
+ struct Object *ob;
+ int options;
+ float fear_factor;
+
+ /* signals */
+ int signal_id, channels;
+} BoidRuleGoalAvoid;
+#define BRULE_ACOLL_WITH_BOIDS 1
+#define BRULE_ACOLL_WITH_DEFLECTORS 2
+typedef struct BoidRuleAvoidCollision {
+ BoidRule rule;
+ int options;
+ float look_ahead;
+} BoidRuleAvoidCollision;
+#define BRULE_LEADER_IN_LINE 1
+typedef struct BoidRuleFollowLeader {
+ BoidRule rule;
+ struct Object *ob;
+ float loc[3], oloc[3];
+ float cfra, distance;
+ int options, queue_size;
+} BoidRuleFollowLeader;
+typedef struct BoidRuleAverageSpeed {
+ BoidRule rule;
+ float wander, level, speed, rt;
+} BoidRuleAverageSpeed;
+typedef struct BoidRuleFight {
+ BoidRule rule;
+ float distance, flee_distance;
+} BoidRuleFight;
+
+typedef enum BoidMode {
+ eBoidMode_InAir = 0,
+ eBoidMode_OnLand = 1,
+ eBoidMode_Climbing = 2,
+ eBoidMode_Falling = 3,
+ eBoidMode_Liftoff = 4,
+ NUM_BOID_MODES
+} BoidMode;
+
+
+typedef struct BoidData {
+ float health, acc[3];
+ short state_id, mode;
+} BoidData;
+
+// planned for near future
+//typedef enum BoidConditionMode {
+// eBoidConditionType_Then = 0,
+// eBoidConditionType_And = 1,
+// eBoidConditionType_Or = 2,
+// NUM_BOID_CONDITION_MODES
+//} BoidConditionMode;
+//typedef enum BoidConditionType {
+// eBoidConditionType_None = 0,
+// eBoidConditionType_Signal = 1,
+// eBoidConditionType_NoSignal = 2,
+// eBoidConditionType_HealthBelow = 3,
+// eBoidConditionType_HealthAbove = 4,
+// eBoidConditionType_See = 5,
+// eBoidConditionType_NotSee = 6,
+// eBoidConditionType_StateTime = 7,
+// eBoidConditionType_Touching = 8,
+// NUM_BOID_CONDITION_TYPES
+//} BoidConditionType;
+//typedef struct BoidCondition {
+// struct BoidCondition *next, *prev;
+// int state_id;
+// short type, mode;
+// float threshold, probability;
+//
+// /* signals */
+// int signal_id, channels;
+//} BoidCondition;
+
+typedef enum BoidRulesetType {
+ eBoidRulesetType_Fuzzy = 0,
+ eBoidRulesetType_Random = 1,
+ eBoidRulesetType_Average = 2,
+ NUM_BOID_RULESET_TYPES
+} BoidRulesetType;
+#define BOIDSTATE_CURRENT 1
+typedef struct BoidState {
+ struct BoidState *next, *prev;
+ ListBase rules;
+ ListBase conditions;
+ ListBase actions;
+ char name[32];
+ int id, flag;
+
+ /* rules */
+ int ruleset_type;
+ float rule_fuzziness;
+
+ /* signal */
+ int signal_id, channels;
+ float volume, falloff;
+} BoidState;
+
+// planned for near future
+//typedef struct BoidSignal {
+// struct BoidSignal *next, *prev;
+// float loc[3];
+// float volume, falloff;
+// int id;
+//} BoidSignal;
+//typedef struct BoidSignalDefine {
+// struct BoidSignalDefine *next, *prev;
+// int id, rt;
+// char name[32];
+//} BoidSignalDefine;
+
+//typedef struct BoidSimulationData {
+// ListBase signal_defines;/* list of defined signals */
+// ListBase signals[20]; /* gathers signals from all channels */
+// struct KDTree *signaltrees[20];
+// char channel_names[20][32];
+// int last_signal_id; /* used for incrementing signal ids */
+// int flag; /* switches for drawing stuff */
+//} BoidSimulationData;
+
+typedef struct BoidSettings {
+ int options, last_state_id;
+
+ float landing_smoothness, height;
+ float banking, pitch;
+
+ float health, aggression;
+ float strength, accuracy, range;
+
+ /* flying related */
+ float air_min_speed, air_max_speed;
+ float air_max_acc, air_max_ave;
+ float air_personal_space;
+
+ /* walk/run related */
+ float land_jump_speed, land_max_speed;
+ float land_max_acc, land_max_ave;
+ float land_personal_space;
+ float land_stick_force;
+
+ struct ListBase states;
+} BoidSettings;
+
+/* boidsettings->options */
+#define BOID_ALLOW_FLIGHT 1
+#define BOID_ALLOW_LAND 2
+#define BOID_ALLOW_CLIMB 4
+
+/* boidrule->options */
+//#define BOID_RULE_FOLLOW_LINE 1 /* follow leader */
+//#define BOID_RULE_PREDICT 2 /* goal/avoid */
+//#define BOID_RULE_ARRIVAL 4 /* goal */
+//#define BOID_RULE_LAND 8 /* goal */
+//#define BOID_RULE_WITH_BOIDS 16 /* avoid collision */
+//#define BOID_RULE_WITH_DEFLECTORS 32 /* avoid collision */
+
+#endif
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index 071b576eda5..17553e98817 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -108,6 +108,8 @@ typedef struct DynamicPaintSurface {
struct EffectorWeights *effector_weights;
/* cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
int current_frame;
/* surface */
@@ -228,6 +230,7 @@ enum {
typedef struct DynamicPaintBrushSettings {
struct DynamicPaintModifierData *pmd; /* for fast RNA access */
struct DerivedMesh *dm;
+ struct ParticleSystem *psys;
struct Material *mat;
int flags;
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index 9e246075e7d..374104d8b13 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -407,6 +407,45 @@ typedef struct Ipo {
#define FLUIDSIM_VEL_FORCE_STR 12
#define FLUIDSIM_VEL_FORCE_RADIUS 13
+/* ******************** */
+/* particle ipos */
+
+/* ******* Particle (ID_PA) ******** */
+#define PART_TOTIPO 25
+#define PART_TOTNAM 25
+
+#define PART_EMIT_FREQ 1
+/* #define PART_EMIT_LIFE 2 */ /*UNUSED*/
+#define PART_EMIT_VEL 3
+#define PART_EMIT_AVE 4
+/* #define PART_EMIT_SIZE 5 */ /*UNUSED*/
+
+#define PART_AVE 6
+#define PART_SIZE 7
+#define PART_DRAG 8
+#define PART_BROWN 9
+#define PART_DAMP 10
+#define PART_LENGTH 11
+#define PART_CLUMP 12
+
+#define PART_GRAV_X 13
+#define PART_GRAV_Y 14
+#define PART_GRAV_Z 15
+
+#define PART_KINK_AMP 16
+#define PART_KINK_FREQ 17
+#define PART_KINK_SHAPE 18
+
+#define PART_BB_TILT 19
+
+#define PART_PD_FSTR 20
+#define PART_PD_FFALL 21
+#define PART_PD_FMAXD 22
+
+#define PART_PD2_FSTR 23
+#define PART_PD2_FFALL 24
+#define PART_PD2_FMAXD 25
+
/* -------------------- Defines: Flags and Types ------------------ */
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 4a3d330a698..f95533a88f9 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -52,8 +52,8 @@ typedef enum ModifierType {
eModifierType_Smooth = 16,
eModifierType_Cast = 17,
eModifierType_MeshDeform = 18,
- /*eModifierType_ParticleSystem = 19,*/ /* DEPRECATED */
- /*eModifierType_ParticleInstance = 20,*/ /* DEPRECATED */
+ eModifierType_ParticleSystem = 19,
+ eModifierType_ParticleInstance = 20,
eModifierType_Explode = 21,
eModifierType_Cloth = 22,
eModifierType_Collision = 23,
@@ -599,6 +599,8 @@ typedef struct ClothModifierData {
struct Cloth *clothObject; /* The internal data structure for cloth. */
struct ClothSimSettings *sim_parms; /* definition is in DNA_cloth_types.h */
struct ClothCollSettings *coll_parms; /* definition is in DNA_cloth_types.h */
+ struct PointCache *point_cache; /* definition is in DNA_object_force.h */
+ struct ListBase ptcaches;
/* XXX nasty hack, remove once hair can be separated from cloth modifier data */
struct ClothHairData *hairdata;
/* grid geometry values of hair continuum */
@@ -718,6 +720,41 @@ enum {
MOD_MDEF_SURFACE = 1,
};
+typedef struct ParticleSystemModifierData {
+ ModifierData modifier;
+
+ struct ParticleSystem *psys;
+ struct DerivedMesh *dm_final; /* Final DM - its topology may differ from orig mesh. */
+ struct DerivedMesh *dm_deformed; /* Deformed-onle DM - its topology is same as orig mesh one. */
+ int totdmvert, totdmedge, totdmface;
+ short flag, pad;
+} ParticleSystemModifierData;
+
+typedef enum {
+ eParticleSystemFlag_Pars = (1 << 0),
+ eParticleSystemFlag_psys_updated = (1 << 1),
+ eParticleSystemFlag_file_loaded = (1 << 2),
+} ParticleSystemModifierFlag;
+
+typedef enum {
+ eParticleInstanceFlag_Parents = (1 << 0),
+ eParticleInstanceFlag_Children = (1 << 1),
+ eParticleInstanceFlag_Path = (1 << 2),
+ eParticleInstanceFlag_Unborn = (1 << 3),
+ eParticleInstanceFlag_Alive = (1 << 4),
+ eParticleInstanceFlag_Dead = (1 << 5),
+ eParticleInstanceFlag_KeepShape = (1 << 6),
+ eParticleInstanceFlag_UseSize = (1 << 7),
+} ParticleInstanceModifierFlag;
+
+typedef struct ParticleInstanceModifierData {
+ ModifierData modifier;
+
+ struct Object *ob;
+ short psys, flag, axis, pad;
+ float position, random_position;
+} ParticleInstanceModifierData;
+
typedef enum {
eExplodeFlag_CalcFaces = (1 << 0),
eExplodeFlag_PaSize = (1 << 1),
@@ -752,6 +789,7 @@ typedef struct FluidsimModifierData {
ModifierData modifier;
struct FluidsimSettings *fss; /* definition is in DNA_object_fluidsim.h */
+ struct PointCache *point_cache; /* definition is in DNA_object_force.h */
} FluidsimModifierData;
typedef struct ShrinkwrapModifierData {
diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h
index 958aea86339..a714195dd5d 100644
--- a/source/blender/makesdna/DNA_object_fluidsim.h
+++ b/source/blender/makesdna/DNA_object_fluidsim.h
@@ -151,7 +151,7 @@ typedef struct FluidsimSettings {
#define OB_FLUIDSIM_OBSTACLE 8
#define OB_FLUIDSIM_INFLOW 16
#define OB_FLUIDSIM_OUTFLOW 32
-#define OB_FLUIDSIM_PARTICLE 64 /* DEPRECATED */
+#define OB_FLUIDSIM_PARTICLE 64
#define OB_FLUIDSIM_CONTROL 128
#define OB_TYPEFLAG_START 7
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 71988d10ecf..59acefeffe4 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -127,6 +127,87 @@ typedef struct EffectorWeights {
/* EffectorWeights->flag */
#define EFF_WEIGHT_DO_HAIR 1
+/* Point cache file data types:
+ * - used as (1<<flag) so poke jahka if you reach the limit of 15
+ * - to add new data types update:
+ * * BKE_ptcache_data_size()
+ * * ptcache_file_init_pointers()
+ */
+#define BPHYS_DATA_INDEX 0
+#define BPHYS_DATA_LOCATION 1
+#define BPHYS_DATA_SMOKE_LOW 1
+#define BPHYS_DATA_VELOCITY 2
+#define BPHYS_DATA_SMOKE_HIGH 2
+#define BPHYS_DATA_ROTATION 3
+#define BPHYS_DATA_DYNAMICPAINT 3
+#define BPHYS_DATA_AVELOCITY 4 /* used for particles */
+#define BPHYS_DATA_XCONST 4 /* used for cloth */
+#define BPHYS_DATA_SIZE 5
+#define BPHYS_DATA_TIMES 6
+#define BPHYS_DATA_BOIDS 7
+
+#define BPHYS_TOT_DATA 8
+
+#define BPHYS_EXTRA_FLUID_SPRINGS 1
+
+typedef struct PTCacheExtra {
+ struct PTCacheExtra *next, *prev;
+ unsigned int type, totdata;
+ void *data;
+} PTCacheExtra;
+
+typedef struct PTCacheMem {
+ struct PTCacheMem *next, *prev;
+ unsigned int frame, totpoint;
+ unsigned int data_types, flag;
+
+ void *data[8]; /* BPHYS_TOT_DATA */
+ void *cur[8]; /* BPHYS_TOT_DATA */
+
+ struct ListBase extradata;
+} PTCacheMem;
+
+typedef struct PointCache {
+ struct PointCache *next, *prev;
+ int flag; /* generic flag */
+
+ int step; /* The number of frames between cached frames.
+ * This should probably be an upper bound for a per point adaptive step in the future,
+ * buf for now it's the same for all points. Without adaptivity this can effect the perceived
+ * simulation quite a bit though. If for example particles are colliding with a horizontal
+ * plane (with high damping) they quickly come to a stop on the plane, however there are still
+ * forces acting on the particle (gravity and collisions), so the particle velocity isn't necessarily
+ * zero for the whole duration of the frame even if the particle seems stationary. If all simulation
+ * frames aren't cached (step > 1) these velocities are interpolated into movement for the non-cached
+ * frames. The result will look like the point is oscillating around the collision location. So for
+ * now cache step should be set to 1 for accurate reproduction of collisions.
+ */
+
+ int simframe; /* current frame of simulation (only if SIMULATION_VALID) */
+ int startframe; /* simulation start frame */
+ int endframe; /* simulation end frame */
+ int editframe; /* frame being edited (runtime only) */
+ int last_exact; /* last exact frame that's cached */
+ int last_valid; /* used for editing cache - what is the last baked frame */
+ int pad;
+
+ /* for external cache files */
+ int totpoint; /* number of cached points */
+ int index; /* modifier stack index */
+ short compression, rt;
+
+ char name[64];
+ char prev_name[64];
+ char info[64];
+ char path[1024]; /* file path, 1024 = FILE_MAX */
+ char *cached_frames; /* array of length endframe-startframe+1 with flags to indicate cached frames */
+ /* can be later used for other per frame flags too if needed */
+ struct ListBase mem_cache;
+
+ struct PTCacheEdit *edit;
+ void (*free_edit)(struct PTCacheEdit *edit); /* free callback */
+} PointCache;
+
typedef struct SBVertex {
float vec[4];
} SBVertex;
@@ -255,6 +336,9 @@ typedef struct SoftBody {
float shearstiff;
float inpush;
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
+
struct Group *collision_group;
struct EffectorWeights *effector_weights;
@@ -310,6 +394,31 @@ typedef struct SoftBody {
#define PFIELD_Z_POS 1
#define PFIELD_Z_NEG 2
+/* pointcache->flag */
+#define PTCACHE_BAKED 1
+#define PTCACHE_OUTDATED 2
+#define PTCACHE_SIMULATION_VALID 4
+#define PTCACHE_BAKING 8
+//#define PTCACHE_BAKE_EDIT 16
+//#define PTCACHE_BAKE_EDIT_ACTIVE 32
+#define PTCACHE_DISK_CACHE 64
+//#define PTCACHE_QUICK_CACHE 128 /* removed since 2.64 - [#30974], could be added back in a more useful way */
+#define PTCACHE_FRAMES_SKIPPED 256
+#define PTCACHE_EXTERNAL 512
+#define PTCACHE_READ_INFO 1024
+/* don't use the filename of the blendfile the data is linked from (write a local cache) */
+#define PTCACHE_IGNORE_LIBPATH 2048
+/* high resolution cache is saved for smoke for backwards compatibility, so set this flag to know it's a "fake" cache */
+#define PTCACHE_FAKE_SMOKE (1<<12)
+#define PTCACHE_IGNORE_CLEAR (1<<13)
+
+/* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */
+#define PTCACHE_REDO_NEEDED 258
+
+#define PTCACHE_COMPRESS_NO 0
+#define PTCACHE_COMPRESS_LZO 1
+#define PTCACHE_COMPRESS_LZMA 2
+
/* ob->softflag */
#define OB_SB_ENABLE 1 /* deprecated, use modifier */
#define OB_SB_GOAL 2
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index ccde6549d9c..d24c7faa9f5 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -51,6 +51,7 @@ struct Material;
struct PartDeflect;
struct SoftBody;
struct FluidsimSettings;
+struct ParticleSystem;
struct DerivedMesh;
struct SculptSession;
struct bGPdata;
@@ -262,6 +263,7 @@ typedef struct Object {
ListBase constraints; /* object constraints */
ListBase nlastrips DNA_DEPRECATED; // XXX deprecated... old animation system
ListBase hooks DNA_DEPRECATED; // XXX deprecated... old animation system
+ ListBase particlesystem; /* particle systems */
struct PartDeflect *pd; /* particle deflector/attractor/collision data */
struct SoftBody *soft; /* if exists, saved in file */
@@ -330,6 +332,9 @@ typedef struct DupliObject {
/* persistent identifier for a dupli object, for inter-frame matching of
* objects with motion blur, or inter-update matching for syncing */
int persistent_id[16]; /* 2*MAX_DUPLI_RECUR */
+
+ /* particle this dupli was generated from */
+ struct ParticleSystem *particle_system;
} DupliObject;
/* **************** OBJECT ********************* */
@@ -668,7 +673,7 @@ typedef enum ObjectMode {
OB_MODE_VERTEX_PAINT = 1 << 2,
OB_MODE_WEIGHT_PAINT = 1 << 3,
OB_MODE_TEXTURE_PAINT = 1 << 4,
- /*OB_MODE_PARTICLE_EDIT = 1 << 5,*/ /* DEPRECATED */
+ OB_MODE_PARTICLE_EDIT = 1 << 5,
OB_MODE_POSE = 1 << 6,
OB_MODE_GPENCIL = 1 << 7, /* NOTE: Just a dummy to make the UI nicer */
} ObjectMode;
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index c26c236b978..8310856510c 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -90,7 +90,7 @@ enum {
#define TSE_SEQUENCE 26 /* NO ID */
#define TSE_SEQ_STRIP 27 /* NO ID */
#define TSE_SEQUENCE_DUP 28 /* NO ID */
-/* #define TSE_LINKED_PSYS 29 */ /* DEPRECATED */
+#define TSE_LINKED_PSYS 29
#define TSE_RNA_STRUCT 30 /* NO ID */
#define TSE_RNA_PROPERTY 31 /* NO ID */
#define TSE_RNA_ARRAY_ELEM 32 /* NO ID */
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
new file mode 100644
index 00000000000..1deb9bf3787
--- /dev/null
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -0,0 +1,613 @@
+/*
+ * ***** 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) 2007 by Janne Karhu.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file DNA_particle_types.h
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_PARTICLE_TYPES_H__
+#define __DNA_PARTICLE_TYPES_H__
+
+#include "DNA_defs.h"
+#include "DNA_ID.h"
+#include "DNA_boid_types.h"
+
+struct AnimData;
+
+typedef struct HairKey {
+ float co[3]; /* location of hair vertex */
+ float time; /* time along hair, default 0-100 */
+ float weight; /* softbody weight */
+ short editflag; /* saved particled edit mode flags */
+ short pad;
+ float world_co[3];
+} HairKey;
+
+typedef struct ParticleKey { /* when changed update size of struct to copy_particleKey()!! */
+ float co[3]; /* location */
+ float vel[3]; /* velocity */
+ float rot[4]; /* rotation quaternion */
+ float ave[3]; /* angular velocity */
+ float time; /* when this key happens */
+} ParticleKey;
+
+typedef struct BoidParticle {
+ struct Object *ground;
+ struct BoidData data;
+ float gravity[3];
+ float wander[3];
+ float rt;
+} BoidParticle;
+
+typedef struct ParticleSpring {
+ float rest_length;
+ unsigned int particle_index[2], delete_flag;
+} ParticleSpring;
+
+/* Child particles are created around or between parent particles */
+typedef struct ChildParticle {
+ int num, parent; /* num is face index on the final derived mesh */
+ int pa[4]; /* nearest particles to the child, used for the interpolation */
+ float w[4]; /* interpolation weights for the above particles */
+ float fuv[4], foffset; /* face vertex weights and offset */
+ float rt;
+} ChildParticle;
+
+typedef struct ParticleTarget {
+ struct ParticleTarget *next, *prev;
+ struct Object *ob;
+ int psys;
+ short flag, mode;
+ float time, duration;
+} ParticleTarget;
+
+typedef struct ParticleDupliWeight {
+ struct ParticleDupliWeight *next, *prev;
+ struct Object *ob;
+ short count;
+ short flag;
+ short index, rt; /* only updated on file save and used on file load */
+} ParticleDupliWeight;
+
+typedef struct ParticleData {
+ ParticleKey state; /* current global coordinates */
+
+ ParticleKey prev_state; /* previous state */
+
+ HairKey *hair; /* hair vertices */
+
+ ParticleKey *keys; /* keyed keys */
+
+ BoidParticle *boid; /* boids data */
+
+ int totkey; /* amount of hair or keyed keys*/
+
+ float time, lifetime; /* dietime is not nescessarily time+lifetime as */
+ float dietime; /* particles can die unnaturally (collision) */
+
+ /* WARNING! Those two indices, when not affected to vertices, are for !!! TESSELLATED FACES !!!, not POLYGONS! */
+ int num; /* index to vert/edge/face */
+ int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */
+
+ float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/
+ /* face normal for volume emission */
+
+ float size; /* size and multiplier so that we can update size when ever */
+
+ float sphdensity; /* density of sph particle */
+ int pad;
+
+ int hair_index;
+ short flag;
+ short alive; /* the life state of a particle */
+} ParticleData;
+
+typedef struct SPHFluidSettings {
+ /*Particle Fluid*/
+ float radius, spring_k, rest_length;
+ float plasticity_constant, yield_ratio;
+ float plasticity_balance, yield_balance;
+ float viscosity_omega, viscosity_beta;
+ float stiffness_k, stiffness_knear, rest_density;
+ float buoyancy;
+ int flag, spring_frames;
+ short solver;
+ short pad[3];
+} SPHFluidSettings;
+
+/* fluid->flag */
+#define SPH_VISCOELASTIC_SPRINGS 1
+#define SPH_CURRENT_REST_LENGTH 2
+#define SPH_FAC_REPULSION 4
+#define SPH_FAC_DENSITY 8
+#define SPH_FAC_RADIUS 16
+#define SPH_FAC_VISCOSITY 32
+#define SPH_FAC_REST_LENGTH 64
+
+/* fluid->solver (numerical ID field, not bitfield) */
+#define SPH_SOLVER_DDR 0
+#define SPH_SOLVER_CLASSICAL 1
+
+typedef struct ParticleSettings {
+ ID id;
+ struct AnimData *adt;
+
+ struct BoidSettings *boids;
+ struct SPHFluidSettings *fluid;
+
+ struct EffectorWeights *effector_weights;
+ struct Group *collision_group;
+
+ int flag, rt;
+ short type, from, distr, texact;
+ /* physics modes */
+ short phystype, rotmode, avemode, reactevent;
+ int draw, pad1;
+ short draw_as, draw_size, childtype, pad2;
+ short ren_as, subframes, draw_col;
+ /* number of path segments, power of 2 except */
+ short draw_step, ren_step;
+ short hair_step, keys_step;
+
+ /* adaptive path rendering */
+ short adapt_angle, adapt_pix;
+
+ short disp, omat, interpolation, integrator;
+ short rotfrom DNA_DEPRECATED;
+ short kink, kink_axis;
+
+ /* billboards */
+ short bb_align, bb_uv_split, bb_anim, bb_split_offset;
+ float bb_tilt, bb_rand_tilt, bb_offset[2], bb_size[2], bb_vel_head, bb_vel_tail;
+
+ /* draw color */
+ float color_vec_max;
+
+ /* simplification */
+ short simplify_flag, simplify_refsize;
+ float simplify_rate, simplify_transition;
+ float simplify_viewport;
+
+ /* time and emission */
+ float sta, end, lifetime, randlife;
+ float timetweak, courant_target;
+ float jitfac, eff_hair, grid_rand, ps_offset[1];
+ int totpart, userjit, grid_res, effector_amount;
+ short time_flag, time_pad[3];
+
+ /* initial velocity factors */
+ float normfac, obfac, randfac, partfac, tanfac, tanphase, reactfac;
+ float ob_vel[3];
+ float avefac, phasefac, randrotfac, randphasefac;
+ /* physical properties */
+ float mass, size, randsize;
+ /* global physical properties */
+ float acc[3], dragfac, brownfac, dampfac;
+ /* length */
+ float randlength;
+ /* children */
+ int child_flag;
+ int pad3;
+ int child_nbr, ren_child_nbr;
+ float parents, childsize, childrandsize;
+ float childrad, childflat;
+ /* clumping */
+ float clumpfac, clumppow;
+ /* kink */
+ float kink_amp, kink_freq, kink_shape, kink_flat;
+ float kink_amp_clump;
+ int kink_extra_steps, pad4;
+ float kink_axis_random, kink_amp_random;
+ /* rough */
+ float rough1, rough1_size;
+ float rough2, rough2_size, rough2_thres;
+ float rough_end, rough_end_shape;
+ /* length */
+ float clength, clength_thres;
+ /* parting */
+ float parting_fac;
+ float parting_min, parting_max;
+ /* branching */
+ float branch_thres;
+ /* drawing stuff */
+ float draw_line[2];
+ float path_start, path_end;
+ int trail_count;
+ /* keyed particles */
+ int keyed_loops;
+ struct CurveMapping *clumpcurve;
+ struct CurveMapping *roughcurve;
+ float clump_noise_size;
+
+ /* hair dynamics */
+ float bending_random;
+
+ struct MTex *mtex[18]; /* MAX_MTEX */
+
+ struct Group *dup_group;
+ struct ListBase dupliweights;
+ struct Group *eff_group DNA_DEPRECATED; // deprecated
+ struct Object *dup_ob;
+ struct Object *bb_ob;
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
+ struct PartDeflect *pd;
+ struct PartDeflect *pd2;
+
+ /* modified dm support */
+ short use_modifier_stack;
+ short pad5[3];
+
+} ParticleSettings;
+
+typedef struct ParticleSystem {
+ /* note1: make sure all (runtime) are NULL's in 'copy_particlesystem' XXX, this function is no more! - need to invstigate */
+ /* note2: make sure any uses of this struct in DNA are accounted for in 'BKE_object_copy_particlesystems' */
+
+ struct ParticleSystem *next, *prev;
+
+ ParticleSettings *part; /* particle settings */
+
+ ParticleData *particles; /* (parent) particles */
+ ChildParticle *child; /* child particles */
+
+ struct PTCacheEdit *edit; /* particle editmode (runtime) */
+ void (*free_edit)(struct PTCacheEdit *edit); /* free callback */
+
+ struct ParticleCacheKey **pathcache; /* path cache (runtime) */
+ struct ParticleCacheKey **childcache; /* child cache (runtime) */
+ ListBase pathcachebufs, childcachebufs; /* buffers for the above */
+
+ struct ClothModifierData *clmd; /* cloth simulation for hair */
+ struct DerivedMesh *hair_in_dm, *hair_out_dm; /* input/output for cloth simulation */
+
+ struct Object *target_ob;
+
+ struct LatticeDeformData *lattice_deform_data; /* run-time only lattice deformation data */
+
+ struct Object *parent; /* particles from global space -> parent space */
+
+ struct ListBase targets; /* used for keyed and boid physics */
+
+ char name[64]; /* particle system name, MAX_NAME */
+
+ float imat[4][4]; /* used for duplicators */
+ float cfra, tree_frame, bvhtree_frame;
+ int seed, child_seed;
+ int flag, totpart, totunexist, totchild, totcached, totchildcache;
+ short recalc, target_psys, totkeyed, bakespace;
+
+ char bb_uvname[3][64]; /* billboard uv name, MAX_CUSTOMDATA_LAYER_NAME */
+
+ /* if you change these remember to update array lengths to PSYS_TOT_VG! */
+ short vgroup[12], vg_neg, rt3; /* vertex groups, 0==disable, 1==starting index */
+
+ /* temporary storage during render */
+ struct ParticleRenderData *renderdata;
+
+ /* point cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
+
+ struct ListBase *effectors;
+
+ ParticleSpring *fluid_springs;
+ int tot_fluidsprings, alloc_fluidsprings;
+
+ struct KDTree *tree; /* used for interactions with self and other systems */
+ struct BVHTree *bvhtree; /* used for interactions with self and other systems */
+
+ struct ParticleDrawData *pdd;
+
+ float dt_frac; /* current time step, as a fraction of a frame */
+ float _pad; /* spare capacity */
+} ParticleSystem;
+
+typedef enum eParticleDrawFlag {
+ PART_DRAW_VEL = (1 << 0),
+ PART_DRAW_GLOBAL_OB = (1 << 1),
+ PART_DRAW_SIZE = (1 << 2),
+ PART_DRAW_EMITTER = (1 << 3), /* render emitter also */
+ PART_DRAW_HEALTH = (1 << 4),
+ PART_ABS_PATH_TIME = (1 << 5),
+ PART_DRAW_COUNT_GR = (1 << 6),
+ PART_DRAW_BB_LOCK = (1 << 7), /* used with billboards */
+ PART_DRAW_ROTATE_OB = (1 << 7), /* used with dupliobjects/groups */
+ PART_DRAW_PARENT = (1 << 8),
+ PART_DRAW_NUM = (1 << 9),
+ PART_DRAW_RAND_GR = (1 << 10),
+ PART_DRAW_REN_ADAPT = (1 << 11),
+ PART_DRAW_VEL_LENGTH = (1 << 12),
+ PART_DRAW_MAT_COL = (1 << 13), /* deprecated, but used in do_versions */
+ PART_DRAW_WHOLE_GR = (1 << 14),
+ PART_DRAW_REN_STRAND = (1 << 15),
+ PART_DRAW_NO_SCALE_OB = (1 << 16), /* used with dupliobjects/groups */
+ PART_DRAW_GUIDE_HAIRS = (1 << 17),
+ PART_DRAW_HAIR_GRID = (1 << 18),
+} eParticleDrawFlag;
+
+/* part->type */
+/* hair is allways baked static in object/geometry space */
+/* other types (normal particles) are in global space and not static baked */
+#define PART_EMITTER 0
+//#define PART_REACTOR 1
+#define PART_HAIR 2
+#define PART_FLUID 3
+
+/* part->flag */
+#define PART_REACT_STA_END 1
+#define PART_REACT_MULTIPLE 2
+
+//#define PART_LOOP 4 /* not used anymore */
+ /* for dopesheet */
+#define PART_DS_EXPAND 8
+
+#define PART_HAIR_REGROW 16 /* regrow hair for each frame */
+
+#define PART_UNBORN 32 /*show unborn particles*/
+#define PART_DIED 64 /*show died particles*/
+
+#define PART_TRAND 128
+#define PART_EDISTR 256 /* particle/face from face areas */
+
+#define PART_ROTATIONS 512 /* calculate particle rotations (and store them in pointcache) */
+#define PART_DIE_ON_COL (1<<12)
+#define PART_SIZE_DEFL (1<<13) /* swept sphere deflections */
+#define PART_ROT_DYN (1<<14) /* dynamic rotation */
+#define PART_SIZEMASS (1<<16)
+
+#define PART_HIDE_ADVANCED_HAIR (1<<15)
+
+//#define PART_ABS_TIME (1<<17)
+//#define PART_GLOB_TIME (1<<18)
+
+#define PART_BOIDS_2D (1<<19)
+
+//#define PART_BRANCHING (1<<20)
+//#define PART_ANIM_BRANCHING (1<<21)
+
+#define PART_HAIR_BSPLINE 1024
+
+#define PART_GRID_HEXAGONAL (1<<24)
+#define PART_GRID_INVERT (1<<26)
+
+#define PART_CHILD_EFFECT (1<<27)
+#define PART_CHILD_LONG_HAIR (1<<28)
+/* #define PART_CHILD_RENDER (1<<29) */ /*UNUSED*/
+#define PART_CHILD_GUIDE (1<<30)
+
+#define PART_SELF_EFFECT (1<<22)
+
+/* part->from */
+#define PART_FROM_VERT 0
+#define PART_FROM_FACE 1
+#define PART_FROM_VOLUME 2
+/* #define PART_FROM_PARTICLE 3 deprecated! */
+#define PART_FROM_CHILD 4
+
+/* part->distr */
+#define PART_DISTR_JIT 0
+#define PART_DISTR_RAND 1
+#define PART_DISTR_GRID 2
+
+/* part->phystype */
+#define PART_PHYS_NO 0
+#define PART_PHYS_NEWTON 1
+#define PART_PHYS_KEYED 2
+#define PART_PHYS_BOIDS 3
+#define PART_PHYS_FLUID 4
+
+/* part->kink */
+typedef enum eParticleKink {
+ PART_KINK_NO = 0,
+ PART_KINK_CURL = 1,
+ PART_KINK_RADIAL = 2,
+ PART_KINK_WAVE = 3,
+ PART_KINK_BRAID = 4,
+ PART_KINK_SPIRAL = 5,
+} eParticleKink;
+
+/* part->child_flag */
+typedef enum eParticleChildFlag {
+ PART_CHILD_USE_CLUMP_NOISE = (1<<0),
+ PART_CHILD_USE_CLUMP_CURVE = (1<<1),
+ PART_CHILD_USE_ROUGH_CURVE = (1<<2),
+} eParticleChildFlag;
+
+/* part->draw_col */
+#define PART_DRAW_COL_NONE 0
+#define PART_DRAW_COL_MAT 1
+#define PART_DRAW_COL_VEL 2
+#define PART_DRAW_COL_ACC 3
+
+
+/* part->simplify_flag */
+#define PART_SIMPLIFY_ENABLE 1
+#define PART_SIMPLIFY_VIEWPORT 2
+
+/* part->time_flag */
+#define PART_TIME_AUTOSF 1 /* Automatic subframes */
+
+/* part->bb_align */
+#define PART_BB_X 0
+#define PART_BB_Y 1
+#define PART_BB_Z 2
+#define PART_BB_VIEW 3
+#define PART_BB_VEL 4
+
+/* part->bb_anim */
+#define PART_BB_ANIM_NONE 0
+#define PART_BB_ANIM_AGE 1
+#define PART_BB_ANIM_ANGLE 2
+#define PART_BB_ANIM_FRAME 3
+
+/* part->bb_split_offset */
+#define PART_BB_OFF_NONE 0
+#define PART_BB_OFF_LINEAR 1
+#define PART_BB_OFF_RANDOM 2
+
+/* part->draw_as */
+/* part->ren_as*/
+#define PART_DRAW_NOT 0
+#define PART_DRAW_DOT 1
+#define PART_DRAW_HALO 1
+#define PART_DRAW_CIRC 2
+#define PART_DRAW_CROSS 3
+#define PART_DRAW_AXIS 4
+#define PART_DRAW_LINE 5
+#define PART_DRAW_PATH 6
+#define PART_DRAW_OB 7
+#define PART_DRAW_GR 8
+#define PART_DRAW_BB 9
+#define PART_DRAW_REND 10
+
+/* part->integrator */
+#define PART_INT_EULER 0
+#define PART_INT_MIDPOINT 1
+#define PART_INT_RK4 2
+#define PART_INT_VERLET 3
+
+/* part->rotmode */
+#define PART_ROT_NOR 1
+#define PART_ROT_VEL 2
+#define PART_ROT_GLOB_X 3
+#define PART_ROT_GLOB_Y 4
+#define PART_ROT_GLOB_Z 5
+#define PART_ROT_OB_X 6
+#define PART_ROT_OB_Y 7
+#define PART_ROT_OB_Z 8
+#define PART_ROT_NOR_TAN 9
+
+/* part->avemode */
+#define PART_AVE_VELOCITY 1
+#define PART_AVE_RAND 2
+#define PART_AVE_HORIZONTAL 3
+#define PART_AVE_VERTICAL 4
+#define PART_AVE_GLOBAL_X 5
+#define PART_AVE_GLOBAL_Y 6
+#define PART_AVE_GLOBAL_Z 7
+
+/* part->reactevent */
+#define PART_EVENT_DEATH 0
+#define PART_EVENT_COLLIDE 1
+#define PART_EVENT_NEAR 2
+
+/* part->childtype */
+#define PART_CHILD_PARTICLES 1
+#define PART_CHILD_FACES 2
+
+/* psys->recalc */
+/* starts from (1 << 3) so that the first bits can be ob->recalc */
+#define PSYS_RECALC_REDO (1 << 3) /* only do pathcache etc */
+#define PSYS_RECALC_RESET (1 << 4) /* reset everything including pointcache */
+#define PSYS_RECALC_TYPE (1 << 5) /* handle system type change */
+#define PSYS_RECALC_CHILD (1 << 6) /* only child settings changed */
+#define PSYS_RECALC_PHYS (1 << 7) /* physics type changed */
+#define PSYS_RECALC (PSYS_RECALC_REDO | PSYS_RECALC_RESET | PSYS_RECALC_TYPE | PSYS_RECALC_CHILD | PSYS_RECALC_PHYS)
+
+/* psys->flag */
+#define PSYS_CURRENT 1
+#define PSYS_GLOBAL_HAIR 2
+#define PSYS_HAIR_DYNAMICS 4
+#define PSYS_KEYED_TIMING 8
+//#define PSYS_ENABLED 16 /* deprecated */
+#define PSYS_HAIR_UPDATED 32 /* signal for updating hair particle mode */
+#define PSYS_DRAWING 64
+#define PSYS_USE_IMAT 128
+#define PSYS_DELETE 256 /* remove particlesystem as soon as possible */
+#define PSYS_HAIR_DONE 512
+#define PSYS_KEYED 1024
+#define PSYS_EDITED 2048
+//#define PSYS_PROTECT_CACHE 4096 /* deprecated */
+#define PSYS_DISABLED 8192
+#define PSYS_OB_ANIM_RESTORE 16384 /* runtime flag */
+
+/* pars->flag */
+#define PARS_UNEXIST 1
+#define PARS_NO_DISP 2
+//#define PARS_STICKY 4 /* deprecated */
+#define PARS_REKEY 8
+
+/* pars->alive */
+//#define PARS_KILLED 0 /* deprecated */
+#define PARS_DEAD 1
+#define PARS_UNBORN 2
+#define PARS_ALIVE 3
+#define PARS_DYING 4
+
+/* ParticleDupliWeight->flag */
+#define PART_DUPLIW_CURRENT 1
+
+/* psys->vg */
+#define PSYS_TOT_VG 12
+
+#define PSYS_VG_DENSITY 0
+#define PSYS_VG_VEL 1
+#define PSYS_VG_LENGTH 2
+#define PSYS_VG_CLUMP 3
+#define PSYS_VG_KINK 4
+#define PSYS_VG_ROUGH1 5
+#define PSYS_VG_ROUGH2 6
+#define PSYS_VG_ROUGHE 7
+#define PSYS_VG_SIZE 8
+#define PSYS_VG_TAN 9
+#define PSYS_VG_ROT 10
+#define PSYS_VG_EFFECTOR 11
+
+/* ParticleTarget->flag */
+#define PTARGET_CURRENT 1
+#define PTARGET_VALID 2
+
+/* ParticleTarget->mode */
+#define PTARGET_MODE_NEUTRAL 0
+#define PTARGET_MODE_FRIEND 1
+#define PTARGET_MODE_ENEMY 2
+
+/* mapto */
+typedef enum eParticleTextureInfluence {
+ /* init */
+ PAMAP_TIME = (1<<0), /* emission time */
+ PAMAP_LIFE = (1<<1), /* life time */
+ PAMAP_DENS = (1<<2), /* density */
+ PAMAP_SIZE = (1<<3), /* physical size */
+ PAMAP_INIT = (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE),
+ /* reset */
+ PAMAP_IVEL = (1<<5), /* initial velocity */
+ /* physics */
+ PAMAP_FIELD = (1<<6), /* force fields */
+ PAMAP_GRAVITY = (1<<10),
+ PAMAP_DAMP = (1<<11),
+ PAMAP_PHYSICS = (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP),
+ /* children */
+ PAMAP_CLUMP = (1<<7),
+ PAMAP_KINK_FREQ = (1<<8),
+ PAMAP_KINK_AMP = (1<<12),
+ PAMAP_ROUGH = (1<<9),
+ PAMAP_LENGTH = (1<<4),
+ PAMAP_CHILD = (PAMAP_CLUMP | PAMAP_KINK_FREQ | PAMAP_KINK_AMP | PAMAP_ROUGH | PAMAP_LENGTH),
+} eParticleTextureInfluence;
+
+#endif
diff --git a/source/blender/makesdna/DNA_rigidbody_types.h b/source/blender/makesdna/DNA_rigidbody_types.h
index 72805c7acb4..381ee5d40e5 100644
--- a/source/blender/makesdna/DNA_rigidbody_types.h
+++ b/source/blender/makesdna/DNA_rigidbody_types.h
@@ -58,6 +58,9 @@ typedef struct RigidBodyWorld {
int pad;
float ltime; /* last frame world was evaluated for (internal) */
+ /* cache */
+ struct PointCache *pointcache;
+ struct ListBase ptcaches;
int numbodies; /* number of objects in rigid body group */
short steps_per_second; /* number of simulation steps thaken per second */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index cf367bf3205..f5e71ae59a9 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1046,6 +1046,39 @@ typedef struct ImagePaintSettings {
} ImagePaintSettings;
/* ------------------------------------------- */
+/* Particle Edit */
+
+/* Settings for a Particle Editing Brush */
+typedef struct ParticleBrushData {
+ short size; /* common setting */
+ short step, invert, count; /* for specific brushes only */
+ int flag;
+ float strength;
+} ParticleBrushData;
+
+/* Particle Edit Mode Settings */
+typedef struct ParticleEditSettings {
+ short flag;
+ short totrekey;
+ short totaddkey;
+ short brushtype;
+
+ ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
+ void *paintcursor; /* runtime */
+
+ float emitterdist, rt;
+
+ int selectmode;
+ int edittype;
+
+ int draw_step, fade_frames;
+
+ struct Scene *scene;
+ struct Object *object;
+ struct Object *shape_object;
+} ParticleEditSettings;
+
+/* ------------------------------------------- */
/* Sculpt */
/* Sculpt */
@@ -1409,6 +1442,9 @@ typedef struct ToolSettings {
/* Image Paint (8 byttse aligned please!) */
struct ImagePaintSettings imapaint;
+ /* Particle Editing */
+ struct ParticleEditSettings particle;
+
/* Transform Proportional Area of Effect */
float proportional_size;
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 4ee83346fe3..c95e0a1f54a 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -188,6 +188,9 @@ typedef struct SmokeDomainSettings {
char data_depth;
char pad[2];
+ /* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading old files. */
+ struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */
+ struct ListBase ptcaches[2];
struct EffectorWeights *effector_weights;
int border_collisions; /* How domain border collisions are handled */
float time_scale;
@@ -242,6 +245,7 @@ typedef struct SmokeDomainSettings {
typedef struct SmokeFlowSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
struct DerivedMesh *dm;
+ struct ParticleSystem *psys;
struct Tex *noise_texture;
/* initial velocity */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index d1b1074e479..5e015544dc9 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -174,7 +174,7 @@ typedef enum eSpaceButtons_Context {
BCONTEXT_DATA = 4,
BCONTEXT_MATERIAL = 5,
BCONTEXT_TEXTURE = 6,
- /*BCONTEXT_PARTICLE = 7,*/ /* DEPRECATED */
+ BCONTEXT_PARTICLE = 7,
BCONTEXT_PHYSICS = 8,
BCONTEXT_BONE = 9,
BCONTEXT_MODIFIER = 10,
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 1c4db5289ef..1dc6c7ab578 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -749,7 +749,7 @@ typedef enum eDupli_ID_Flags {
USER_DUP_TEX = (1 << 8),
USER_DUP_ARM = (1 << 9),
USER_DUP_ACT = (1 << 10),
- /*USER_DUP_PSYS = (1 << 11),*/ /* DEPRECATED */
+ USER_DUP_PSYS = (1 << 11)
} eDupli_ID_Flags;
/* gameflags */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 0f7ed8c0bc0..2cea8715a65 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -114,10 +114,12 @@ static const char *includefiles[] = {
"DNA_color_types.h",
"DNA_brush_types.h",
"DNA_customdata_types.h",
+ "DNA_particle_types.h",
"DNA_cloth_types.h",
"DNA_gpencil_types.h",
"DNA_windowmanager_types.h",
"DNA_anim_types.h",
+ "DNA_boid_types.h",
"DNA_smoke_types.h",
"DNA_speaker_types.h",
"DNA_movieclip_types.h",
@@ -1324,10 +1326,12 @@ int main(int argc, char **argv)
#include "DNA_color_types.h"
#include "DNA_brush_types.h"
#include "DNA_customdata_types.h"
+#include "DNA_particle_types.h"
#include "DNA_cloth_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_anim_types.h"
+#include "DNA_boid_types.h"
#include "DNA_smoke_types.h"
#include "DNA_speaker_types.h"
#include "DNA_movieclip_types.h"