[Bf-blender-cvs] [9064655a70c] master: Mantaflow [Part 10]: Updated fluid modifier settings
Sebastián Barschkis
noreply at git.blender.org
Mon Dec 16 16:31:44 CET 2019
Commit: 9064655a70c6353e6702d518efcc11f2bb0f6377
Author: Sebastián Barschkis
Date: Mon Dec 16 15:43:58 2019 +0100
Branches: master
https://developer.blender.org/rB9064655a70c6353e6702d518efcc11f2bb0f6377
Mantaflow [Part 10]: Updated fluid modifier settings
All the new fluid simulation parameters need to be added the according structs (i.e. domain settings, flow settings).
Reviewed By: sergey
Maniphest Tasks: T59995
Differential Revision: https://developer.blender.org/D3860
===================================================================
A source/blender/makesdna/DNA_fluid_types.h
===================================================================
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
new file mode 100644
index 00000000000..f9e1487bb39
--- /dev/null
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -0,0 +1,581 @@
+/*
+ * 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) 2006 by NaN Holding BV.
+ * All rights reserved.
+ */
+
+/** \file
+ * \ingroup DNA
+ */
+
+#ifndef __DNA_FLUID_TYPES_H__
+#define __DNA_FLUID_TYPES_H__
+
+/* Domain flags. */
+enum {
+ 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
+ FLUID_DOMAIN_USE_HIGH_SMOOTH = (1 << 5), /* -- Deprecated -- */
+#endif
+ 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. */
+ FLUID_DOMAIN_USE_FRACTIONS = (1 << 13), /* Use second order obstacles. */
+};
+
+/* 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 {
+ FLUID_DOMAIN_SLICE_VIEW_ALIGNED = 0,
+ FLUID_DOMAIN_SLICE_AXIS_ALIGNED = 1,
+};
+
+/* Axis aligned method. */
+enum {
+ AXIS_SLICE_FULL = 0,
+ AXIS_SLICE_SINGLE = 1,
+};
+
+/* Single slice direction. */
+enum {
+ SLICE_AXIS_AUTO = 0,
+ SLICE_AXIS_X = 1,
+ SLICE_AXIS_Y = 2,
+ SLICE_AXIS_Z = 3,
+};
+
+/* Axis aligned method. */
+enum {
+ VOLUME_INTERP_LINEAR = 0,
+ VOLUME_INTERP_CUBIC = 1,
+};
+
+enum {
+ VECTOR_DRAW_NEEDLE = 0,
+ VECTOR_DRAW_STREAMLINE = 1,
+};
+
+enum {
+ 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,
+};
+
+/* Fluid domain types. */
+enum {
+ FLUID_DOMAIN_TYPE_GAS = 0,
+ FLUID_DOMAIN_TYPE_LIQUID = 1,
+};
+
+/* Smoke noise types. */
+enum {
+ FLUID_NOISE_TYPE_WAVELET = (1 << 0),
+};
+
+/* Mesh levelset generator types. */
+enum {
+ FLUID_DOMAIN_MESH_IMPROVED = 0,
+ FLUID_DOMAIN_MESH_UNION = 1,
+};
+
+/* Guiding velocity source. */
+enum {
+ FLUID_DOMAIN_GUIDING_SRC_DOMAIN = 0,
+ FLUID_DOMAIN_GUIDING_SRC_EFFECTOR = 1,
+};
+
+/* Fluid data fields (active_fields). */
+enum {
+ FLUID_DOMAIN_ACTIVE_HEAT = (1 << 0),
+ FLUID_DOMAIN_ACTIVE_FIRE = (1 << 1),
+ FLUID_DOMAIN_ACTIVE_COLORS = (1 << 2),
+ FLUID_DOMAIN_ACTIVE_COLOR_SET = (1 << 3),
+ FLUID_DOMAIN_ACTIVE_OBSTACLE = (1 << 4),
+ FLUID_DOMAIN_ACTIVE_GUIDING = (1 << 5),
+ FLUID_DOMAIN_ACTIVE_INVEL = (1 << 6),
+ FLUID_DOMAIN_ACTIVE_OUTFLOW = (1 << 7),
+};
+
+/* Particle types. */
+enum {
+ FLUID_DOMAIN_PARTICLE_FLIP = (1 << 0),
+ FLUID_DOMAIN_PARTICLE_SPRAY = (1 << 1),
+ FLUID_DOMAIN_PARTICLE_BUBBLE = (1 << 2),
+ FLUID_DOMAIN_PARTICLE_FOAM = (1 << 3),
+ FLUID_DOMAIN_PARTICLE_TRACER = (1 << 4),
+};
+
+/* Liquid simulation methods. */
+enum {
+ FLUID_DOMAIN_METHOD_FLIP = (1 << 0),
+ FLUID_DOMAIN_METHOD_APIC = (1 << 1),
+};
+
+/* Cache options. */
+enum {
+ FLUID_DOMAIN_BAKING_DATA = (1 << 0),
+ FLUID_DOMAIN_BAKED_DATA = (1 << 1),
+ FLUID_DOMAIN_BAKING_NOISE = (1 << 2),
+ FLUID_DOMAIN_BAKED_NOISE = (1 << 3),
+ FLUID_DOMAIN_BAKING_MESH = (1 << 4),
+ FLUID_DOMAIN_BAKED_MESH = (1 << 5),
+ FLUID_DOMAIN_BAKING_PARTICLES = (1 << 6),
+ FLUID_DOMAIN_BAKED_PARTICLES = (1 << 7),
+ FLUID_DOMAIN_BAKING_GUIDING = (1 << 8),
+ FLUID_DOMAIN_BAKED_GUIDING = (1 << 9),
+ FLUID_DOMAIN_OUTDATED_DATA = (1 << 10),
+ FLUID_DOMAIN_OUTDATED_NOISE = (1 << 11),
+ FLUID_DOMAIN_OUTDATED_MESH = (1 << 12),
+ FLUID_DOMAIN_OUTDATED_PARTICLES = (1 << 13),
+ FLUID_DOMAIN_OUTDATED_GUIDING = (1 << 14),
+};
+
+#define FLUID_DOMAIN_DIR_DEFAULT "cache_fluid"
+#define FLUID_DOMAIN_DIR_CONFIG "config"
+#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"
+
+enum {
+ FLUID_DOMAIN_CACHE_REPLAY = 0,
+ FLUID_DOMAIN_CACHE_MODULAR = 1,
+ FLUID_DOMAIN_CACHE_FINAL = 2,
+};
+
+/* Deprecated values (i.e. all defines and enums below this line up until typedefs). */
+/* Cache compression. */
+enum {
+ SM_CACHE_LIGHT = 0,
+ SM_CACHE_HEAVY = 1,
+};
+
+/* High resolution sampling types. */
+enum {
+ SM_HRES_NEAREST = 0,
+ SM_HRES_LINEAR = 1,
+ SM_HRES_FULLSAMPLE = 2,
+};
+
+enum {
+ VDB_COMPRESSION_BLOSC = 0,
+ VDB_COMPRESSION_ZIP = 1,
+ VDB_COMPRESSION_NONE = 2,
+};
+
+typedef struct FluidDomainVertexVelocity {
+ float vel[3];
+} FluidDomainVertexVelocity;
+
+typedef struct FluidDomainSettings {
+
+ /* -- Runtime-only fields (from here on). -- */
+
+ struct FluidModifierData *mmd; /* For fast RNA access. */
+ struct MANTA *fluid;
+ struct MANTA *fluid_old; /* Adaptive domain needs access to old fluid state. */
+ void *fluid_mutex;
+ struct Collection *fluid_group;
+ struct Collection *force_group; /* UNUSED */
+ struct Collection *effector_group; /* Effector objects group. */
+ struct GPUTexture *tex;
+ struct GPUTexture *tex_wt;
+ struct GPUTexture *tex_shadow;
+ struct GPUTexture *tex_flame;
+ struct GPUTexture *tex_flame_coba;
+ struct GPUTexture *tex_coba;
+ struct GPUTexture *tex_field;
+ struct GPUTexture *tex_velocity_x;
+ struct GPUTexture *tex_velocity_y;
+ struct GPUTexture *tex_velocity_z;
+ struct Object *guiding_parent;
+ struct FluidDomainVertexVelocity *mesh_velocities; /* Vertex velocities of simulated fluid mesh. */
+ struct EffectorWeights *effector_weights;
+
+ /* 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. */
+ float cell_size[3]; /* Size of simulation cell in local space. */
+ float global_size[3]; /* Global size of domain axises. */
+ float prev_loc[3];
+ int shift[3]; /* Current domain shift in simulation cells. */
+ float shift_f[3]; /* Exact domain shift. */
+ float obj_shift_f[3]; /* How much object has shifted since previous smoke frame (used to "lock"
+ * domain while drawing). */
+ float imat[4][4]; /* Domain object imat. */
+ 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 scale; /* Largest domain size. */
+ int boundary_width; /* Usually this is just 1. */
+
+ /* -- User-accesible fields (from here on). -- */
+
+ /* Adaptive domain options. */
+ int adapt_margin;
+ int adapt_res;
+ float adapt_threshold;
+ char _pad1[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 _pad2[6]; /* Unused. */
+
+ /* Smoke domain options. */
+ float alpha;
+ float beta;
+ int diss_speed; /* In frames. */
+ float vorticity;
+ float active_color[3]; /* Monitor smoke color. */
+ int highres_sampling;
+
+ /* Flame options. */
+ float burning_rate, flame_smoke, flame_vorticity;
+ float flame_ignition, flame_max_temp;
+ float flame_smoke_color[3];
+
+ /* Noise options. */
+ float noise_strength;
+ float noise_pos_scale;
+ fl
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list