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:
authorHans Goudey <h.goudey@me.com>2020-06-10 00:31:59 +0300
committerHans Goudey <h.goudey@me.com>2020-06-10 00:31:59 +0300
commit5ecc239c0afb92cdf083a599c1986674a5626395 (patch)
treeea1c6303e0e36440a291e20d23708c0a0cbb78cf /source/blender/makesdna
parentb6764b9a31f069f6fc08f3e34f9c9a6ed14a3f53 (diff)
parentd3f83d9f95504ad02121228477681db6702e9e11 (diff)
Merge branch 'master' into modifier-panels-ui
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_brush_types.h1
-rw-r--r--source/blender/makesdna/DNA_fluid_types.h188
-rw-r--r--source/blender/makesdna/DNA_object_force_types.h136
-rw-r--r--source/blender/makesdna/DNA_pointcache_types.h170
-rw-r--r--source/blender/makesdna/DNA_simulation_types.h40
-rw-r--r--source/blender/makesdna/intern/makesdna.c2
6 files changed, 351 insertions, 186 deletions
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index be7c894b4e4..7490dbe5cdc 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -334,6 +334,7 @@ typedef enum eBrushClothForceFalloffType {
typedef enum eBrushPoseDeformType {
BRUSH_POSE_DEFORM_ROTATE_TWIST = 0,
BRUSH_POSE_DEFORM_SCALE_TRASLATE = 1,
+ BRUSH_POSE_DEFORM_SQUASH_STRETCH = 2,
} eBrushPoseDeformType;
typedef enum eBrushPoseOriginType {
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
index 7da33a369f3..e8a22d8c821 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -215,55 +215,145 @@ enum {
#define FLUID_DOMAIN_SMOKE_SCRIPT "smoke_script.py"
#define FLUID_DOMAIN_LIQUID_SCRIPT "liquid_script.py"
-#define FLUID_FILENAME_CONFIG "config_####"
-
-#define FLUID_FILENAME_DATA "fluid_data_####"
-#define FLUID_FILENAME_NOISE "fluid_noise_####"
-#define FLUID_FILENAME_DENSITY "density_####"
-#define FLUID_FILENAME_SHADOW "shadow_####"
-#define FLUID_FILENAME_VELOCITY "vel_####"
-#define FLUID_FILENAME_HEAT "heat_####"
-#define FLUID_FILENAME_COLORR "color_r_####"
-#define FLUID_FILENAME_COLORG "color_g_####"
-#define FLUID_FILENAME_COLORB "color_b_####"
-#define FLUID_FILENAME_FLAME "flame_####"
-#define FLUID_FILENAME_FUEL "fuel_####"
-#define FLUID_FILENAME_REACT "react_####"
-#define FLUID_FILENAME_PHI "phi_####"
-#define FLUID_FILENAME_PP "pp_####"
-#define FLUID_FILENAME_PVEL "pVel_####"
-#define FLUID_FILENAME_DENSITYNOISE "density_noise_####"
-#define FLUID_FILENAME_COLORRNOISE "color_r_noise_####"
-#define FLUID_FILENAME_COLORGNOISE "color_g_noise_####"
-#define FLUID_FILENAME_COLORBNOISE "color_b_noise_####"
-#define FLUID_FILENAME_FLAMENOISE "flame_noise_####"
-#define FLUID_FILENAME_FUELNOISE "fuel_noise_####"
-#define FLUID_FILENAME_REACTNOISE "react_noise_####"
-#define FLUID_FILENAME_MESH "lMesh_####"
-#define FLUID_FILENAME_MESHVEL "lVelMesh_####"
-#define FLUID_FILENAME_PPSND "ppSnd_####"
-#define FLUID_FILENAME_PVELSND "pVelSnd_####"
-#define FLUID_FILENAME_PLIFESND "pLifeSnd_####"
-#define FLUID_FILENAME_GUIDEVEL "guidevel_####"
-
-#define FLUID_GRIDNAME_DENSITY "density"
-#define FLUID_GRIDNAME_SHADOW "shadow"
-#define FLUID_GRIDNAME_VELOCITY "velocity"
-#define FLUID_GRIDNAME_HEAT "heat"
-#define FLUID_GRIDNAME_COLORR "color_r"
-#define FLUID_GRIDNAME_COLORG "color_g"
-#define FLUID_GRIDNAME_COLORB "color_b"
-#define FLUID_GRIDNAME_FLAME "flame"
-#define FLUID_GRIDNAME_FUEL "fuel"
-#define FLUID_GRIDNAME_REACT "react"
-#define FLUID_GRIDNAME_DENSITYNOISE "density_noise"
-#define FLUID_GRIDNAME_COLORRNOISE "color_r_noise"
-#define FLUID_GRIDNAME_COLORGNOISE "color_g_noise"
-#define FLUID_GRIDNAME_COLORBNOISE "color_b_noise"
-#define FLUID_GRIDNAME_FLAMENOISE "flame_noise"
-#define FLUID_GRIDNAME_FUELNOISE "fuel_noise"
-#define FLUID_GRIDNAME_REACTNOISE "react_noise"
-
+/* Cache file names. */
+#define FLUID_NAME_CONFIG "config"
+#define FLUID_NAME_DATA "fluid_data"
+#define FLUID_NAME_NOISE "fluid_noise"
+#define FLUID_NAME_MESH "fluid_mesh"
+#define FLUID_NAME_PARTICLES "fluid_particles"
+#define FLUID_NAME_GUIDING "fluid_guiding"
+
+/* Fluid object names.*/
+#define FLUID_NAME_FLAGS "flags"
+#define FLUID_NAME_VELOCITY "vel"
+#define FLUID_NAME_VELOCITYTMP "velocityTmp"
+#define FLUID_NAME_VELOCITYX "x_vel"
+#define FLUID_NAME_VELOCITYY "y_vel"
+#define FLUID_NAME_VELOCITYZ "z_vel"
+#define FLUID_NAME_PRESSURE "pressure"
+#define FLUID_NAME_PHIOBS "phiObs"
+#define FLUID_NAME_PHISIN "phiSIn"
+#define FLUID_NAME_PHIIN "phiIn"
+#define FLUID_NAME_PHIOUT "phiOut"
+#define FLUID_NAME_FORCES "forces"
+#define FLUID_NAME_FORCE_X "x_force"
+#define FLUID_NAME_FORCE_Y "y_force"
+#define FLUID_NAME_FORCE_Z "z_force"
+#define FLUID_NAME_NUMOBS "numObs"
+#define FLUID_NAME_PHIOBSSIN "phiObsSIn"
+#define FLUID_NAME_PHIOBSIN "phiObsIn"
+#define FLUID_NAME_OBVEL "obvel"
+#define FLUID_NAME_OBVELC "obvelC"
+#define FLUID_NAME_OBVEL_X "x_obvel"
+#define FLUID_NAME_OBVEL_Y "y_obvel"
+#define FLUID_NAME_OBVEL_Z "z_obvel"
+#define FLUID_NAME_FRACTIONS "fractions"
+#define FLUID_NAME_INVELC "invelC"
+#define FLUID_NAME_INVEL "invel"
+#define FLUID_NAME_INVEL_X "x_invel"
+#define FLUID_NAME_INVEL_Y "y_invel"
+#define FLUID_NAME_INVEL_Z "z_invel"
+#define FLUID_NAME_PHIOUTSIN "phiOutSIn"
+#define FLUID_NAME_PHIOUTIN "phiOutIn"
+
+/* Smoke object names. */
+#define FLUID_NAME_SHADOW "shadow"
+#define FLUID_NAME_EMISSION "emission"
+#define FLUID_NAME_EMISSIONIN "emissionIn"
+#define FLUID_NAME_DENSITY "density"
+#define FLUID_NAME_DENSITYIN "densityIn"
+#define FLUID_NAME_HEAT "heat"
+#define FLUID_NAME_HEATIN "heatIn"
+#define FLUID_NAME_COLORR "color_r"
+#define FLUID_NAME_COLORG "color_g"
+#define FLUID_NAME_COLORB "color_b"
+#define FLUID_NAME_COLORRIN "color_r_in"
+#define FLUID_NAME_COLORGIN "color_g_in"
+#define FLUID_NAME_COLORBIN "color_b_in"
+#define FLUID_NAME_FLAME "flame"
+#define FLUID_NAME_FUEL "fuel"
+#define FLUID_NAME_REACT "react"
+#define FLUID_NAME_FUELIN "fuelIn"
+#define FLUID_NAME_REACTIN "reactIn"
+
+/* Liquid object names. */
+#define FLUID_NAME_PHIPARTS "phiParts"
+#define FLUID_NAME_PHI "phi"
+#define FLUID_NAME_PHITMP "phiTmp"
+#define FLUID_NAME_VELOCITYOLD "velOld"
+#define FLUID_NAME_VELOCITYPARTS "velParts"
+#define FLUID_NAME_MAPWEIGHTS "mapWeights"
+#define FLUID_NAME_PP "pp"
+#define FLUID_NAME_PVEL "pVel"
+#define FLUID_NAME_PINDEX "pindex"
+#define FLUID_NAME_GPI "gpi"
+#define FLUID_NAME_CURVATURE "gpi"
+
+/* Noise object names. */
+#define FLUID_NAME_VELOCITY_NOISE "velocity_noise"
+#define FLUID_NAME_DENSITY_NOISE "density_noise"
+#define FLUID_NAME_PHIIN_NOISE "phiIn_noise"
+#define FLUID_NAME_PHIOUT_NOISE "phiOut_noise"
+#define FLUID_NAME_PHIOBS_NOISE "phiObs_noise"
+#define FLUID_NAME_FLAGS_NOISE "flags_noise"
+#define FLUID_NAME_TMPIN_NOISE "tmpIn_noise"
+#define FLUID_NAME_EMISSIONIN_NOISE "emissionIn_noise"
+#define FLUID_NAME_ENERGY "energy"
+#define FLUID_NAME_TMPFLAGS "tmpFlags"
+#define FLUID_NAME_TEXTURE_U "textureU"
+#define FLUID_NAME_TEXTURE_V "textureV"
+#define FLUID_NAME_TEXTURE_W "textureW"
+#define FLUID_NAME_TEXTURE_U2 "textureU2"
+#define FLUID_NAME_TEXTURE_V2 "textureV2"
+#define FLUID_NAME_TEXTURE_W2 "textureW2"
+#define FLUID_NAME_UV0 "uvGrid0"
+#define FLUID_NAME_UV1 "uvGrid1"
+#define FLUID_NAME_COLORR_NOISE "color_r_noise"
+#define FLUID_NAME_COLORG_NOISE "color_g_noise"
+#define FLUID_NAME_COLORB_NOISE "color_b_noise"
+#define FLUID_NAME_FLAME_NOISE "flame_noise"
+#define FLUID_NAME_FUEL_NOISE "fuel_noise"
+#define FLUID_NAME_REACT_NOISE "react_noise"
+
+/* Mesh object names. */
+#define FLUID_NAME_PHIPARTS_MESH "phiParts_mesh"
+#define FLUID_NAME_PHI_MESH "phi_mesh"
+#define FLUID_NAME_PP_MESH "pp_mesh"
+#define FLUID_NAME_FLAGS_MESH "flags_mesh"
+#define FLUID_NAME_LMESH "lMesh"
+#define FLUID_NAME_VELOCITYVEC_MESH "lVelMesh"
+#define FLUID_NAME_VELOCITY_MESH "velocity_mesh"
+#define FLUID_NAME_PINDEX_MESH "pindex_mesh"
+#define FLUID_NAME_GPI_MESH "gpi_mesh"
+
+/* Particles object names. */
+#define FLUID_NAME_PP_PARTICLES "ppSnd"
+#define FLUID_NAME_PVEL_PARTICLES "pVelSnd"
+#define FLUID_NAME_PFORCE_PARTICLES "pForceSnd"
+#define FLUID_NAME_PLIFE_PARTICLES "pLifeSnd"
+#define FLUID_NAME_VELOCITY_PARTICLES "velocity_particles"
+#define FLUID_NAME_FLAGS_PARTICLES "flags_particles"
+#define FLUID_NAME_PHI_PARTICLES "phi_particles"
+#define FLUID_NAME_PHIOBS_PARTICLES "phiObs_particles"
+#define FLUID_NAME_PHIOUT_PARTICLES "phiOut_particles"
+#define FLUID_NAME_NORMAL_PARTICLES "normal_particles"
+#define FLUID_NAME_NEIGHBORRATIO_PARTICLES "neighborRatio_particles"
+#define FLUID_NAME_TRAPPEDAIR_PARTICLES "trappedAir_particles"
+#define FLUID_NAME_WAVECREST_PARTICLES "waveCrest_particles"
+#define FLUID_NAME_KINETICENERGY_PARTICLES "kineticEnergy_particles"
+
+/* Guiding object names. */
+#define FLUID_NAME_VELT "velT"
+#define FLUID_NAME_WEIGHTGUIDE "weightGuide"
+#define FLUID_NAME_NUMGUIDES "numGuides"
+#define FLUID_NAME_PHIGUIDEIN "phiGuideIn"
+#define FLUID_NAME_GUIDEVELC "guidevelC"
+#define FLUID_NAME_GUIDEVEL_X "x_guidevel"
+#define FLUID_NAME_GUIDEVEL_Y "Y_guidevel"
+#define FLUID_NAME_GUIDEVEL_Z "z_guidevel"
+#define FLUID_NAME_GUIDEVEL "guidevel"
+
+/* Cache file extensions. */
#define FLUID_DOMAIN_EXTENSION_UNI ".uni"
#define FLUID_DOMAIN_EXTENSION_OPENVDB ".vdb"
#define FLUID_DOMAIN_EXTENSION_RAW ".raw"
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index 85520f5a930..7f022f104e6 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -186,111 +186,6 @@ 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_pointers_init()
- */
-#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;
-
- /** BPHYS_TOT_DATA. */
- void *data[8];
- /** BPHYS_TOT_DATA. */
- void *cur[8];
-
- struct ListBase extradata;
-} PTCacheMem;
-
-typedef struct PointCache {
- struct PointCache *next, *prev;
- /** Generic flag. */
- int flag;
-
- /**
- * 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 step;
-
- /** Current frame of simulation (only if SIMULATION_VALID). */
- int simframe;
- /** Simulation start frame. */
- int startframe;
- /** Simulation end frame. */
- int endframe;
- /** Frame being edited (runtime only). */
- int editframe;
- /** Last exact frame that's cached. */
- int last_exact;
- /** Used for editing cache - what is the last baked frame. */
- int last_valid;
- char _pad[4];
-
- /* for external cache files */
- /** Number of cached points. */
- int totpoint;
- /** Modifier stack index. */
- int index;
- short compression, rt;
-
- char name[64];
- char prev_name[64];
- char info[128];
- /** File path, 1024 = FILE_MAX. */
- char path[1024];
-
- /**
- * Array of length `endframe - startframe + 1` with flags to indicate cached frames.
- * Can be later used for other per frame flags too if needed.
- */
- char *cached_frames;
- int cached_frames_len;
- char _pad1[4];
-
- struct ListBase mem_cache;
-
- struct PTCacheEdit *edit;
- /** Free callback. */
- void (*free_edit)(struct PTCacheEdit *edit);
-} PointCache;
-
typedef struct SBVertex {
float vec[4];
} SBVertex;
@@ -478,37 +373,6 @@ typedef struct SoftBody {
#define PFIELD_Z_POS 1
#define PFIELD_Z_NEG 2
-/* pointcache->flag */
-#define PTCACHE_BAKED (1 << 0)
-#define PTCACHE_OUTDATED (1 << 1)
-#define PTCACHE_SIMULATION_VALID (1 << 2)
-#define PTCACHE_BAKING (1 << 3)
-//#define PTCACHE_BAKE_EDIT (1 << 4)
-//#define PTCACHE_BAKE_EDIT_ACTIVE (1 << 5)
-#define PTCACHE_DISK_CACHE (1 << 6)
-///* removed since 2.64 - [#30974], could be added back in a more useful way */
-//#define PTCACHE_QUICK_CACHE (1 << 7)
-#define PTCACHE_FRAMES_SKIPPED (1 << 8)
-#define PTCACHE_EXTERNAL (1 << 9)
-#define PTCACHE_READ_INFO (1 << 10)
-/** don't use the filename of the blendfile the data is linked from (write a local cache) */
-#define PTCACHE_IGNORE_LIBPATH (1 << 11)
-/**
- * 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)
-
-#define PTCACHE_FLAG_INFO_DIRTY (1 << 14)
-
-/* 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_pointcache_types.h b/source/blender/makesdna/DNA_pointcache_types.h
new file mode 100644
index 00000000000..fcdc22ca56d
--- /dev/null
+++ b/source/blender/makesdna/DNA_pointcache_types.h
@@ -0,0 +1,170 @@
+/*
+ * 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.
+ */
+
+/** \file
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_POINTCACHE_TYPES_H__
+#define __DNA_POINTCACHE_TYPES_H__
+
+#include "DNA_listBase.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * 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_pointers_init()
+ */
+#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;
+
+ /** BPHYS_TOT_DATA. */
+ void *data[8];
+ /** BPHYS_TOT_DATA. */
+ void *cur[8];
+
+ struct ListBase extradata;
+} PTCacheMem;
+
+typedef struct PointCache {
+ struct PointCache *next, *prev;
+ /** Generic flag. */
+ int flag;
+
+ /**
+ * 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 step;
+
+ /** Current frame of simulation (only if SIMULATION_VALID). */
+ int simframe;
+ /** Simulation start frame. */
+ int startframe;
+ /** Simulation end frame. */
+ int endframe;
+ /** Frame being edited (runtime only). */
+ int editframe;
+ /** Last exact frame that's cached. */
+ int last_exact;
+ /** Used for editing cache - what is the last baked frame. */
+ int last_valid;
+ char _pad[4];
+
+ /* for external cache files */
+ /** Number of cached points. */
+ int totpoint;
+ /** Modifier stack index. */
+ int index;
+ short compression, rt;
+
+ char name[64];
+ char prev_name[64];
+ char info[128];
+ /** File path, 1024 = FILE_MAX. */
+ char path[1024];
+
+ /**
+ * Array of length `endframe - startframe + 1` with flags to indicate cached frames.
+ * Can be later used for other per frame flags too if needed.
+ */
+ char *cached_frames;
+ int cached_frames_len;
+ char _pad1[4];
+
+ struct ListBase mem_cache;
+
+ struct PTCacheEdit *edit;
+ /** Free callback. */
+ void (*free_edit)(struct PTCacheEdit *edit);
+} PointCache;
+
+/* pointcache->flag */
+#define PTCACHE_BAKED (1 << 0)
+#define PTCACHE_OUTDATED (1 << 1)
+#define PTCACHE_SIMULATION_VALID (1 << 2)
+#define PTCACHE_BAKING (1 << 3)
+//#define PTCACHE_BAKE_EDIT (1 << 4)
+//#define PTCACHE_BAKE_EDIT_ACTIVE (1 << 5)
+#define PTCACHE_DISK_CACHE (1 << 6)
+///* removed since 2.64 - [#30974], could be added back in a more useful way */
+//#define PTCACHE_QUICK_CACHE (1 << 7)
+#define PTCACHE_FRAMES_SKIPPED (1 << 8)
+#define PTCACHE_EXTERNAL (1 << 9)
+#define PTCACHE_READ_INFO (1 << 10)
+/** don't use the filename of the blendfile the data is linked from (write a local cache) */
+#define PTCACHE_IGNORE_LIBPATH (1 << 11)
+/**
+ * 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)
+
+#define PTCACHE_FLAG_INFO_DIRTY (1 << 14)
+
+/* 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
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DNA_POINTCACHE_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_simulation_types.h b/source/blender/makesdna/DNA_simulation_types.h
index 113c301bb9e..93ba9c425f0 100644
--- a/source/blender/makesdna/DNA_simulation_types.h
+++ b/source/blender/makesdna/DNA_simulation_types.h
@@ -22,6 +22,7 @@
#define __DNA_SIMULATION_TYPES_H__
#include "DNA_ID.h"
+#include "DNA_customdata_types.h"
typedef struct Simulation {
ID id;
@@ -30,12 +31,49 @@ typedef struct Simulation {
struct bNodeTree *nodetree;
int flag;
- int _pad1[1];
+ int _pad;
+
+ /** List containing SimulationState objects. */
+ struct ListBase states;
} Simulation;
+typedef struct SimulationState {
+ struct SimulationState *next;
+ struct SimulationState *prev;
+
+ /** This is only initialized on cow copies of the simulation. It points to the state on the
+ * original data block. That is where the cache is stored. */
+ struct SimulationState *orig_state;
+
+ /** eSimulationStateType */
+ int type;
+ int _pad;
+
+ char name[64];
+} SimulationState;
+
+typedef struct ParticleSimulationState {
+ SimulationState head;
+
+ /** Contains the state of the particles at time current_frame. */
+ float current_frame;
+ int tot_particles;
+ struct CustomData attributes;
+
+ /** Caches the state of the particles over time. The cache only exists on the original data
+ * block, not on cow copies. */
+ struct PointCache *point_cache;
+ struct ListBase ptcaches;
+} ParticleSimulationState;
+
/* Simulation.flag */
enum {
SIM_DS_EXPAND = (1 << 0),
};
+/* SimulationCache.type */
+typedef enum eSimulationStateType {
+ SIM_STATE_TYPE_PARTICLES = 0,
+} eSimulationStateType;
+
#endif /* __DNA_SIMULATION_TYPES_H__ */
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 09cfe54e94d..083806350e7 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -137,6 +137,7 @@ static const char *includefiles[] = {
"DNA_pointcloud_types.h",
"DNA_volume_types.h",
"DNA_simulation_types.h",
+ "DNA_pointcache_types.h",
/* see comment above before editing! */
@@ -1584,6 +1585,7 @@ int main(int argc, char **argv)
#include "DNA_outliner_types.h"
#include "DNA_packedFile_types.h"
#include "DNA_particle_types.h"
+#include "DNA_pointcache_types.h"
#include "DNA_pointcloud_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"