Blender  V2.93
DNA_fluid_defaults.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 /* Struct members on own line. */
24 /* clang-format off */
25 
26 /* -------------------------------------------------------------------- */
30 #define _DNA_DEFAULT_FluidDomainSettings \
31  { \
32  .fmd = NULL, \
33  .fluid = NULL, \
34  .fluid_old = NULL, \
35  .fluid_mutex = NULL, \
36  .fluid_group = NULL, \
37  .force_group = NULL, \
38  .effector_group = NULL, \
39  .tex_density = NULL, \
40  .tex_color = NULL, \
41  .tex_wt = NULL, \
42  .tex_shadow = NULL, \
43  .tex_flame = NULL, \
44  .tex_flame_coba = NULL, \
45  .tex_coba = NULL, \
46  .tex_field = NULL, \
47  .tex_velocity_x = NULL, \
48  .tex_velocity_y = NULL, \
49  .tex_velocity_z = NULL, \
50  .tex_flags = NULL, \
51  .tex_range_field = NULL, \
52  .guide_parent = NULL, \
53  .mesh_velocities = NULL, \
54  .effector_weights = NULL, /* #BKE_effector_add_weights. */ \
55  .p0 = {0.0f, 0.0f, 0.0f}, \
56  .p1 = {0.0f, 0.0f, 0.0f}, \
57  .dp0 = {0.0f, 0.0f, 0.0f}, \
58  .cell_size = {0.0f, 0.0f, 0.0f}, \
59  .global_size = {0.0f, 0.0f, 0.0f}, \
60  .prev_loc = {0.0f, 0.0f, 0.0f}, \
61  .shift = {0, 0, 0}, \
62  .shift_f = {0.0f, 0.0f, 0.0f}, \
63  .obj_shift_f = {0.0f, 0.0f, 0.0f}, \
64  .imat = _DNA_DEFAULT_UNIT_M4, \
65  .obmat = _DNA_DEFAULT_UNIT_M4, \
66  .fluidmat = _DNA_DEFAULT_UNIT_M4, \
67  .fluidmat_wt = _DNA_DEFAULT_UNIT_M4, \
68  .base_res = {0, 0, 0}, \
69  .res_min = {0, 0, 0}, \
70  .res_max = {0, 0, 0}, \
71  .res = {0, 0, 0}, \
72  .total_cells = 0, \
73  .dx = 0, \
74  .scale = 0.0f, \
75  .boundary_width = 1, \
76  .gravity_final = {0.0f, 0.0f, 0.0f}, \
77  .adapt_margin = 4, \
78  .adapt_res = 0, \
79  .adapt_threshold = 0.02f, \
80  .maxres = 32, \
81  .solver_res = 3, \
82  .border_collisions = 0, \
83  .flags = FLUID_DOMAIN_USE_DISSOLVE_LOG | FLUID_DOMAIN_USE_ADAPTIVE_TIME, \
84  .gravity = {0.0f, 0.0f, -9.81f}, \
85  .active_fields = 0, \
86  .type = FLUID_DOMAIN_TYPE_GAS, \
87  .alpha = 1.0f, \
88  .beta = 1.0f, \
89  .diss_speed = 5, \
90  .vorticity = 0.0f, \
91  .active_color = {0.0f, 0.0f, 0.0f}, \
92  .highres_sampling = SM_HRES_FULLSAMPLE, \
93  .burning_rate = 0.75f, \
94  .flame_smoke = 1.0f, \
95  .flame_vorticity = 0.5f, \
96  .flame_ignition = 1.5f, \
97  .flame_max_temp = 3.0f, \
98  .flame_smoke_color = {0.7f, 0.7f, 0.7f}, \
99  .noise_strength = 1.0f, \
100  .noise_pos_scale = 2.0f, \
101  .noise_time_anim = 0.1f, \
102  .res_noise = {0, 0, 0}, \
103  .noise_scale = 2, \
104  .noise_type = FLUID_NOISE_TYPE_WAVELET, \
105  .particle_randomness = 0.1f, \
106  .particle_number = 2, \
107  .particle_minimum = 8, \
108  .particle_maximum = 16, \
109  .particle_radius = 1.0f, \
110  .particle_band_width = 3.0f, \
111  .fractions_threshold = 0.05f, \
112  .fractions_distance = 0.5f, \
113  .flip_ratio = 0.97f, \
114  .sys_particle_maximum = 0, \
115  .simulation_method = FLUID_DOMAIN_METHOD_FLIP, \
116  .viscosity_value = 0.05f, \
117  .surface_tension = 0.0f, \
118  .viscosity_base = 1.0f, \
119  .viscosity_exponent = 6.0f, \
120  .mesh_concave_upper = 3.5f, \
121  .mesh_concave_lower = 0.4f, \
122  .mesh_particle_radius = 2.0f, \
123  .mesh_smoothen_pos = 1, \
124  .mesh_smoothen_neg = 1, \
125  .mesh_scale = 2, \
126  .totvert = 0, \
127  .mesh_generator = FLUID_DOMAIN_MESH_IMPROVED, \
128  .particle_type = 0, \
129  .particle_scale = 1, \
130  .sndparticle_tau_min_wc = 2.0f, \
131  .sndparticle_tau_max_wc = 8.0f, \
132  .sndparticle_tau_min_ta = 5.0f, \
133  .sndparticle_tau_max_ta = 20.0f, \
134  .sndparticle_tau_min_k = 1.0f, \
135  .sndparticle_tau_max_k = 5.0f, \
136  .sndparticle_k_wc = 200, \
137  .sndparticle_k_ta = 40, \
138  .sndparticle_k_b = 0.5f, \
139  .sndparticle_k_d = 0.6f, \
140  .sndparticle_l_min = 10.0f, \
141  .sndparticle_l_max = 25.0f, \
142  .sndparticle_potential_radius = 2, \
143  .sndparticle_update_radius = 2, \
144  .sndparticle_boundary = SNDPARTICLE_BOUNDARY_DELETE, \
145  .sndparticle_combined_export = SNDPARTICLE_COMBINED_EXPORT_OFF, \
146  .guide_alpha = 2.0f, \
147  .guide_beta = 5, \
148  .guide_vel_factor = 2.0f, \
149  .guide_res = {0, 0, 0}, \
150  .guide_source = FLUID_DOMAIN_GUIDE_SRC_DOMAIN, \
151  .cache_frame_start = 1, \
152  .cache_frame_end = 250, \
153  .cache_frame_pause_data = 0, \
154  .cache_frame_pause_noise = 0, \
155  .cache_frame_pause_mesh = 0, \
156  .cache_frame_pause_particles = 0, \
157  .cache_frame_pause_guide = 0, \
158  .cache_frame_offset = 0, \
159  .cache_flag = 0, \
160  .cache_mesh_format = FLUID_DOMAIN_FILE_BIN_OBJECT, \
161  .cache_data_format = FLUID_DOMAIN_FILE_OPENVDB, \
162  .cache_particle_format = FLUID_DOMAIN_FILE_OPENVDB, \
163  .cache_noise_format = FLUID_DOMAIN_FILE_OPENVDB, \
164  .cache_directory = "", \
165  .error = "", \
166  .cache_type = FLUID_DOMAIN_CACHE_REPLAY, \
167  .cache_id = "", \
168  .dt = 0.0f, \
169  .time_total = 0.0f, \
170  .time_per_frame = 0.0f, \
171  .frame_length = 0.0f, \
172  .time_scale = 1.0f, \
173  .cfl_condition = 4.0f, \
174  .timesteps_minimum = 1, \
175  .timesteps_maximum = 4, \
176  .slice_per_voxel = 5.0f, \
177  .slice_depth = 0.5f, \
178  .display_thickness = 1.0f, \
179  .grid_scale = 1.0f, \
180  .coba = NULL, \
181  .vector_scale = 1.0f, \
182  .gridlines_lower_bound = 0.0f, \
183  .gridlines_upper_bound = 1.0f, \
184  .gridlines_range_color = {1.0f, 0.0f, 0.0f, 1.0f}, \
185  .axis_slice_method = AXIS_SLICE_FULL, \
186  .slice_axis = 0, \
187  .show_gridlines = false, \
188  .draw_velocity = false, \
189  .vector_draw_type = VECTOR_DRAW_NEEDLE, \
190  .vector_field = FLUID_DOMAIN_VECTOR_FIELD_VELOCITY, \
191  .vector_scale_with_magnitude = true, \
192  .vector_draw_mac_components = VECTOR_DRAW_MAC_X | VECTOR_DRAW_MAC_Y | VECTOR_DRAW_MAC_Z, \
193  .use_coba = false, \
194  .coba_field = FLUID_DOMAIN_FIELD_DENSITY, \
195  .interp_method = FLUID_DISPLAY_INTERP_LINEAR, \
196  .gridlines_color_field = 0, \
197  .gridlines_cell_filter = FLUID_CELL_TYPE_NONE, \
198  .openvdb_compression = VDB_COMPRESSION_BLOSC, \
199  .clipping = 1e-6f, \
200  .openvdb_data_depth = 0, \
201  .viewsettings = 0, \
202  .point_cache = {NULL, NULL}, /* Use #BKE_ptcache_add. */ \
203  .ptcaches = {{NULL}}, \
204  .cache_comp = SM_CACHE_LIGHT, \
205  .cache_high_comp = SM_CACHE_LIGHT, \
206  .cache_file_format = 0, \
207  }
208 
211 /* -------------------------------------------------------------------- */
215 #define _DNA_DEFAULT_FluidFlowSettings \
216  { \
217  .fmd = NULL, \
218  .mesh = NULL, \
219  .psys = NULL, \
220  .noise_texture = NULL, \
221  .verts_old = NULL, \
222  .numverts = 0, \
223  .vel_multi = 1.0f, \
224  .vel_normal = 0.0f, \
225  .vel_random = 0.0f, \
226  .vel_coord = {0.0f, 0.0f, 0.0f}, \
227  .density = 1.0f, \
228  .color = {0.7f, 0.7f, 0.7f}, \
229  .fuel_amount = 1.0f, \
230  .temperature = 1.0f, \
231  .volume_density = 0.0f, \
232  .surface_distance = 1.5f, \
233  .particle_size = 1.0f, \
234  .subframes = 0, \
235  .texture_size = 1.0f, \
236  .texture_offset = 0.0f, \
237  .uvlayer_name = "", \
238  .vgroup_density = 0, \
239  .type = FLUID_FLOW_TYPE_SMOKE, \
240  .behavior = FLUID_FLOW_BEHAVIOR_GEOMETRY, \
241  .source = FLUID_FLOW_SOURCE_MESH, \
242  .texture_type = 0, \
243  .flags = FLUID_FLOW_ABSOLUTE | FLUID_FLOW_USE_PART_SIZE | FLUID_FLOW_USE_INFLOW, \
244  }
245 
248 /* -------------------------------------------------------------------- */
252 #define _DNA_DEFAULT_FluidEffectorSettings \
253  { \
254  .fmd = NULL, \
255  .mesh = NULL, \
256  .verts_old = NULL, \
257  .numverts = 0, \
258  .surface_distance = 0.0f, \
259  .flags = FLUID_EFFECTOR_USE_EFFEC, \
260  .subframes = 0, \
261  .type = FLUID_EFFECTOR_TYPE_COLLISION, \
262  .vel_multi = 1.0f, \
263  .guide_mode = FLUID_EFFECTOR_GUIDE_OVERRIDE, \
264  }
265 
268 /* clang-format on */