[Bf-blender-cvs] [85e757257ef] fluid-mantaflow: Mantaflow: Updated fluid modifier settings

Sebastián Barschkis noreply at git.blender.org
Sat Apr 6 22:13:11 CEST 2019


Commit: 85e757257ef8fd0f2a482a6108c19e6deadbdc65
Author: Sebastián Barschkis
Date:   Sun Oct 28 18:24:45 2018 +0100
Branches: fluid-mantaflow
https://developer.blender.org/rB85e757257ef8fd0f2a482a6108c19e6deadbdc65

Mantaflow: Updated fluid modifier settings

Updated fields for domain, flow and effector settings

===================================================================

M	source/blender/makesdna/DNA_smoke_types.h

===================================================================

diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index b8ac0de0090..3cc03ef533a 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -21,6 +21,7 @@
  * The Original Code is: all of this file.
  *
  * Contributor(s): Daniel Genrich (Genscher)
+ *                 Sebastian Barschkis (sebbas)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -34,28 +35,45 @@
 
 /* flags */
 enum {
-	MOD_SMOKE_HIGHRES = (1 << 1),  /* enable high resolution */
-	MOD_SMOKE_DISSOLVE = (1 << 2),  /* let smoke dissolve */
-	MOD_SMOKE_DISSOLVE_LOG = (1 << 3),  /* using 1/x for dissolve */
+	FLUID_DOMAIN_USE_NOISE = (1 << 1),  /* use noise */
+	FLUID_DOMAIN_USE_DISSOLVE = (1 << 2),  /* let smoke dissolve */
+	FLUID_DOMAIN_USE_DISSOLVE_LOG = (1 << 3),  /* using 1/x for dissolve */
 
 #ifdef DNA_DEPRECATED
-	MOD_SMOKE_HIGH_SMOOTH = (1 << 5),  /* -- Deprecated -- */
+	FLUID_DOMAIN_USE_HIGH_SMOOTH = (1 << 5),  /* -- Deprecated -- */
 #endif
-	MOD_SMOKE_FILE_LOAD = (1 << 6),  /* flag for file load */
-	MOD_SMOKE_ADAPTIVE_DOMAIN = (1 << 7),
+	FLUID_DOMAIN_FILE_LOAD = (1 << 6),  /* flag for file load */
+	FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN = (1 << 7),
+	FLUID_DOMAIN_USE_ADAPTIVE_TIME = (1 << 8), /* adaptive time stepping in domain */
+	FLUID_DOMAIN_USE_MESH = (1 << 9),  /* use mesh */
+	FLUID_DOMAIN_USE_GUIDING = (1 << 10),  /* use guiding */
+	FLUID_DOMAIN_USE_SPEED_VECTORS = (1 << 11),  /* generate mesh speed vectors */
+	FLUID_DOMAIN_EXPORT_MANTA_SCRIPT = (1 << 12),  /* export mantaflow script during bake */
 };
 
-/* noise */
-#define MOD_SMOKE_NOISEWAVE (1<<0)
-#define MOD_SMOKE_NOISEFFT (1<<1)
-#define MOD_SMOKE_NOISECURL (1<<2)
-/* viewsettings */
-#define MOD_SMOKE_VIEW_SHOWBIG (1<<0)
+/* border collisions */
+enum {
+	FLUID_DOMAIN_BORDER_FRONT = (1 << 1),
+	FLUID_DOMAIN_BORDER_BACK = (1 << 2),
+	FLUID_DOMAIN_BORDER_RIGHT = (1 << 3),
+	FLUID_DOMAIN_BORDER_LEFT = (1 << 4),
+	FLUID_DOMAIN_BORDER_TOP = (1 << 5),
+	FLUID_DOMAIN_BORDER_BOTTOM = (1 << 6),
+};
+
+/* cache file formats */
+enum {
+	FLUID_DOMAIN_FILE_UNI = (1 << 0),
+	FLUID_DOMAIN_FILE_OPENVDB = (1 << 1),
+	FLUID_DOMAIN_FILE_RAW = (1 << 2),
+	FLUID_DOMAIN_FILE_OBJECT = (1 << 3),
+	FLUID_DOMAIN_FILE_BIN_OBJECT = (1 << 4),
+};
 
 /* slice method */
 enum {
-	MOD_SMOKE_SLICE_VIEW_ALIGNED = 0,
-	MOD_SMOKE_SLICE_AXIS_ALIGNED = 1,
+	FLUID_DOMAIN_SLICE_VIEW_ALIGNED = 0,
+	FLUID_DOMAIN_SLICE_AXIS_ALIGNED = 1,
 };
 
 /* axis aligned method */
@@ -78,61 +96,116 @@ enum {
 };
 
 enum {
-	FLUID_FIELD_DENSITY    = 0,
-	FLUID_FIELD_HEAT       = 1,
-	FLUID_FIELD_FUEL       = 2,
-	FLUID_FIELD_REACT      = 3,
-	FLUID_FIELD_FLAME      = 4,
-	FLUID_FIELD_VELOCITY_X = 5,
-	FLUID_FIELD_VELOCITY_Y = 6,
-	FLUID_FIELD_VELOCITY_Z = 7,
-	FLUID_FIELD_COLOR_R    = 8,
-	FLUID_FIELD_COLOR_G    = 9,
-	FLUID_FIELD_COLOR_B    = 10,
-	FLUID_FIELD_FORCE_X    = 11,
-	FLUID_FIELD_FORCE_Y    = 12,
-	FLUID_FIELD_FORCE_Z    = 13,
+	SNDPARTICLE_BOUNDARY_DELETE = 0,
+	SNDPARTICLE_BOUNDARY_PUSHOUT = 1,
 };
 
+enum {
+	SNDPARTICLE_COMBINED_EXPORT_OFF = 0,
+	SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM = 1,
+	SNDPARTICLE_COMBINED_EXPORT_SPRAY_BUBBLE = 2,
+	SNDPARTICLE_COMBINED_EXPORT_FOAM_BUBBLE = 3,
+	SNDPARTICLE_COMBINED_EXPORT_SPRAY_FOAM_BUBBLE = 4,
+};
+
+enum {
+	FLUID_DOMAIN_FIELD_DENSITY    = 0,
+	FLUID_DOMAIN_FIELD_HEAT       = 1,
+	FLUID_DOMAIN_FIELD_FUEL       = 2,
+	FLUID_DOMAIN_FIELD_REACT      = 3,
+	FLUID_DOMAIN_FIELD_FLAME      = 4,
+	FLUID_DOMAIN_FIELD_VELOCITY_X = 5,
+	FLUID_DOMAIN_FIELD_VELOCITY_Y = 6,
+	FLUID_DOMAIN_FIELD_VELOCITY_Z = 7,
+	FLUID_DOMAIN_FIELD_COLOR_R    = 8,
+	FLUID_DOMAIN_FIELD_COLOR_G    = 9,
+	FLUID_DOMAIN_FIELD_COLOR_B    = 10,
+	FLUID_DOMAIN_FIELD_FORCE_X    = 11,
+	FLUID_DOMAIN_FIELD_FORCE_Y    = 12,
+	FLUID_DOMAIN_FIELD_FORCE_Z    = 13,
+};
+
+/* domain types */
+#define FLUID_DOMAIN_TYPE_GAS    0
+#define FLUID_DOMAIN_TYPE_LIQUID 1
+
+/* noise */
+#define FLUID_NOISE_TYPE_WAVELET (1<<0)
+
+/* mesh levelset generator types */
+#define FLUID_DOMAIN_MESH_IMPROVED    0
+#define FLUID_DOMAIN_MESH_UNION       1
+
+/* guiding velocity source */
+#define FLUID_DOMAIN_GUIDING_SRC_DOMAIN   0
+#define FLUID_DOMAIN_GUIDING_SRC_EFFECTOR 1
+
+/* fluid data fields (active_fields) */
+#define FLUID_DOMAIN_ACTIVE_HEAT      (1<<0)
+#define FLUID_DOMAIN_ACTIVE_FIRE      (1<<1)
+#define FLUID_DOMAIN_ACTIVE_COLORS    (1<<2)
+#define FLUID_DOMAIN_ACTIVE_COLOR_SET (1<<3)
+#define FLUID_DOMAIN_ACTIVE_OBSTACLE  (1<<4)
+#define FLUID_DOMAIN_ACTIVE_GUIDING   (1<<5)
+#define FLUID_DOMAIN_ACTIVE_INVEL     (1<<6)
+
+/* particle types */
+#define FLUID_DOMAIN_PARTICLE_FLIP   (1<<0)
+#define FLUID_DOMAIN_PARTICLE_SPRAY  (1<<1)
+#define FLUID_DOMAIN_PARTICLE_BUBBLE (1<<2)
+#define FLUID_DOMAIN_PARTICLE_FOAM  (1<<3)
+#define FLUID_DOMAIN_PARTICLE_TRACER (1<<4)
+
+/* cache options */
+#define FLUID_DOMAIN_BAKING_DATA         1
+#define FLUID_DOMAIN_BAKED_DATA          2
+#define FLUID_DOMAIN_BAKING_NOISE        4
+#define FLUID_DOMAIN_BAKED_NOISE         8
+#define FLUID_DOMAIN_BAKING_MESH         16
+#define FLUID_DOMAIN_BAKED_MESH          32
+#define FLUID_DOMAIN_BAKING_PARTICLES    64
+#define FLUID_DOMAIN_BAKED_PARTICLES     128
+#define FLUID_DOMAIN_BAKING_GUIDING      256
+#define FLUID_DOMAIN_BAKED_GUIDING       512
+
+#define FLUID_DOMAIN_DIR_DEFAULT    "cache_fluid"
+#define FLUID_DOMAIN_DIR_DATA       "data"
+#define FLUID_DOMAIN_DIR_NOISE      "noise"
+#define FLUID_DOMAIN_DIR_MESH       "mesh"
+#define FLUID_DOMAIN_DIR_PARTICLES  "particles"
+#define FLUID_DOMAIN_DIR_GUIDING    "guiding"
+#define FLUID_DOMAIN_DIR_SCRIPT     "script"
+#define FLUID_DOMAIN_SMOKE_SCRIPT   "smoke_script.py"
+#define FLUID_DOMAIN_LIQUID_SCRIPT  "liquid_script.py"
+
+/* Deprecated values (i.e. all defines and enums below this line up until typedefs)*/
 /* cache compression */
 #define SM_CACHE_LIGHT		0
 #define SM_CACHE_HEAVY		1
 
-/* domain border collision */
-#define SM_BORDER_OPEN		0
-#define SM_BORDER_VERTICAL	1
-#define SM_BORDER_CLOSED	2
-
-/* collision types */
-#define SM_COLL_STATIC		0
-#define SM_COLL_RIGID		1
-#define SM_COLL_ANIMATED	2
-
 /* high resolution sampling types */
 #define SM_HRES_NEAREST		0
 #define SM_HRES_LINEAR		1
 #define SM_HRES_FULLSAMPLE	2
 
-/* smoke data fields (active_fields) */
-#define SM_ACTIVE_HEAT		(1<<0)
-#define SM_ACTIVE_FIRE		(1<<1)
-#define SM_ACTIVE_COLORS	(1<<2)
-#define SM_ACTIVE_COLOR_SET	(1<<3)
-
 enum {
 	VDB_COMPRESSION_BLOSC = 0,
 	VDB_COMPRESSION_ZIP   = 1,
 	VDB_COMPRESSION_NONE  = 2,
 };
 
+typedef struct SmokeVertexVelocity {
+	float vel[3];
+} SmokeVertexVelocity;
+
 typedef struct SmokeDomainSettings {
 	struct SmokeModifierData *smd; /* for fast RNA access */
-	struct FLUID_3D *fluid;
+	struct FLUID *fluid;
+	struct FLUID *fluid_old; /* adaptive domain needs access to old fluid state */
 	void *fluid_mutex;
 	struct Collection *fluid_group;
 	struct Collection *eff_group; // UNUSED
 	struct Collection *coll_group; // collision objects group
-	struct WTURBULENCE *wt; // WTURBULENCE object, if active
 	struct GPUTexture *tex;
 	struct GPUTexture *tex_wt;
 	struct GPUTexture *tex_shadow;
@@ -143,9 +216,11 @@ typedef struct SmokeDomainSettings {
 	struct GPUTexture *tex_velocity_x;
 	struct GPUTexture *tex_velocity_y;
 	struct GPUTexture *tex_velocity_z;
-	float *shadow;
+	struct Object *guiding_parent;
+	struct SmokeVertexVelocity *mesh_velocities; /* vertex velocities of simulated fluid mesh */
+	struct EffectorWeights *effector_weights;
 
-	/* simulation data */
+	/* domain object data */
 	float p0[3]; /* start point of BB in local space (includes sub-cell shift for adaptive domain)*/
 	float p1[3]; /* end point of BB in local space */
 	float dp0[3]; /* difference from object center to grid start point */
@@ -159,97 +234,186 @@ typedef struct SmokeDomainSettings {
 	float obmat[4][4]; /* domain obmat */
 	float fluidmat[4][4]; /* low res fluid matrix */
 	float fluidmat_wt[4][4]; /* high res fluid matrix */
-
 	int base_res[3]; /* initial "non-adapted" resolution */
 	int res_min[3]; /* cell min */
 	int res_max[3]; /* cell max */
 	int res[3]; /* data resolution (res_max-res_min) */
 	int total_cells;
 	float dx; /* 1.0f / res */
+	float dt;
 	float scale; /* largest domain size */
 
-	/* user settings */
+	/* adaptive domain options */
 	int adapt_margin;
 	int adapt_res;
 	float adapt_threshold;
+	char pad_adaptive[4]; /* unused */
 
+	/* fluid domain options */
+	int maxres; /* longest axis on the BB gets this resolution assigned */
+	int solver_res;	/* dimension of manta solver, 2d or 3d */
+	int border_collisions;	/* How domain border collisions are handled */
+	int flags; /* use-mesh, use-noise, etc. */
+	float gravity[3];
+	int active_fields;
+	short type; /* gas, liquid */
+	char pad_fluid[6]; /* unused */
+
+	/* smoke domain options */
 	float alpha;
 	float beta;
-	int amplify; /* wavelet amplification */
-	int maxres; /* longest axis on the BB gets this resolution assigned */
-	int flags; /* show up-res or low res, etc */
-	int viewsettings;
-	short noise; /* noise type: wave, curl, anisotropic */
-	short diss_percent;
 	int diss_speed;/* in frames */
-	float strength;
-	int res_wt[3];
-	float dx_wt;
-	/* point cache options */
-	int cache_comp;
-	int cache_high_comp;
-	/* OpenVDB cache options */
-	int openvdb_comp;
-	char cache_file_format;
-	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_types.h */
-	struct ListBase ptcaches[2];
-	struct EffectorWeights *effector_weights;
-	int border_collisions;	/* How domain border collisions are handled */
-	float time_scale;
 	float vorticity;
-	int active_fields;
-	float active_color[3]; /* monitor color situation of simulation */
+	float active_color[3]; /* monitor smoke color */
 	int highres_sampling;
 
-	/* flame parameters */
+	/* flame options */
 	float burning_rate, flame_smoke, flame_vorticity;
 	float flame_ignition, flame_max_temp;
 	float flame_smoke_color[3];
 
-	/* Display settings */
+	/* noise options */
+	float noise_strength;
+	float noise_pos_scale;
+	float noise_t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list