120
130
{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
121
131
{0, NULL, 0, NULL, NULL}};
133
static EnumPropertyItem smoke_domain_colli_items[] = {
134
{SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
135
{SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open",
136
"Smoke doesn't collide with top and bottom sides"},
137
{SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
138
{0, NULL, 0, NULL, NULL}};
123
140
srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
124
141
RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
125
142
RNA_def_struct_sdna(srna, "SmokeDomainSettings");
126
143
RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");
128
prop= RNA_def_property(srna, "maxres", PROP_INT, PROP_NONE);
145
prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
129
146
RNA_def_property_int_sdna(prop, NULL, "maxres");
130
147
RNA_def_property_range(prop, 24, 512);
131
148
RNA_def_property_ui_range(prop, 24, 512, 2, 0);
132
149
RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain");
150
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
133
151
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
135
prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
153
prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
136
154
RNA_def_property_int_sdna(prop, NULL, "amplify");
137
155
RNA_def_property_range(prop, 1, 10);
138
156
RNA_def_property_ui_range(prop, 1, 10, 1, 0);
139
157
RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
158
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
140
159
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
142
prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE);
161
prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
143
162
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
144
163
RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
164
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
145
165
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
147
prop= RNA_def_property(srna, "viewhighres", PROP_BOOLEAN, PROP_NONE);
167
prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
148
168
RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG);
149
169
RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
150
170
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
152
prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
172
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
153
173
RNA_def_property_enum_sdna(prop, NULL, "noise");
154
174
RNA_def_property_enum_items(prop, prop_noise_type_items);
155
175
RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
176
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
156
177
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
158
prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
179
prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
159
180
RNA_def_property_float_sdna(prop, NULL, "alpha");
160
181
RNA_def_property_range(prop, -5.0, 5.0);
161
182
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
162
RNA_def_property_ui_text(prop, "Gravity", "Higher value results in sinking smoke");
183
RNA_def_property_ui_text(prop, "Density",
184
"How much density affects smoke motion (higher value results in faster rising smoke)");
163
185
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
165
prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
187
prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
166
188
RNA_def_property_float_sdna(prop, NULL, "beta");
167
189
RNA_def_property_range(prop, -5.0, 5.0);
168
190
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
169
RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke");
191
RNA_def_property_ui_text(prop, "Heat",
192
"How much heat affects smoke motion (higher value results in faster rising smoke)");
170
193
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
172
prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE);
195
prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
173
196
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
174
197
RNA_def_property_struct_type(prop, "Group");
175
198
RNA_def_property_flag(prop, PROP_EDITABLE);
176
199
RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group");
177
200
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
179
prop= RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
202
prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
180
203
RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
181
204
RNA_def_property_struct_type(prop, "Group");
182
205
RNA_def_property_flag(prop, PROP_EDITABLE);
183
206
RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group");
184
207
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
186
prop= RNA_def_property(srna, "eff_group", PROP_POINTER, PROP_NONE);
209
prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
187
210
RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
188
211
RNA_def_property_struct_type(prop, "Group");
189
212
RNA_def_property_flag(prop, PROP_EDITABLE);
190
213
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group");
191
214
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
193
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
216
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
194
217
RNA_def_property_float_sdna(prop, NULL, "strength");
195
RNA_def_property_range(prop, 1.0, 10.0);
196
RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2);
197
RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise");
218
RNA_def_property_range(prop, 0.0, 10.0);
219
RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
220
RNA_def_property_ui_text(prop, "Strength", "Strength of noise");
198
221
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
200
prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
223
prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
201
224
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
202
RNA_def_property_range(prop, 1.0, 100.0);
203
RNA_def_property_ui_range(prop, 1.0, 1000.0, 1, 0);
225
RNA_def_property_range(prop, 1.0, 10000.0);
226
RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0);
204
227
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
205
RNA_def_property_update(prop, 0, NULL);
207
prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
208
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_INITVELOCITY);
209
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
210
RNA_def_property_update(prop, 0, NULL);
212
prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
228
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
230
prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
213
231
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
214
232
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
215
RNA_def_property_update(prop, 0, NULL);
233
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
217
prop= RNA_def_property(srna, "dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
235
prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
218
236
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
219
237
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
220
RNA_def_property_update(prop, 0, NULL);
238
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
222
prop= RNA_def_property(srna, "point_cache_low", PROP_POINTER, PROP_NONE);
240
prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
223
241
RNA_def_property_flag(prop, PROP_NEVER_NULL);
224
242
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
225
243
RNA_def_property_ui_text(prop, "Point Cache", "");
227
prop= RNA_def_property(srna, "point_cache_high", PROP_POINTER, PROP_NONE);
228
RNA_def_property_flag(prop, PROP_NEVER_NULL);
229
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]");
230
RNA_def_property_ui_text(prop, "Point Cache", "");
232
prop= RNA_def_property(srna, "smoke_cache_comp", PROP_ENUM, PROP_NONE);
245
prop = RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE);
233
246
RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
234
247
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
235
248
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
236
RNA_def_property_update(prop, 0, NULL);
238
prop= RNA_def_property(srna, "smoke_cache_high_comp", PROP_ENUM, PROP_NONE);
239
RNA_def_property_enum_sdna(prop, NULL, "cache_high_comp");
240
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
241
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
242
RNA_def_property_update(prop, 0, NULL);
245
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
250
prop = RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
251
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
252
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
253
RNA_def_property_ui_text(prop, "Border Collisions",
254
"Select which domain border will be treated as collision object");
255
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
257
prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
246
258
RNA_def_property_struct_type(prop, "EffectorWeights");
247
259
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
248
260
RNA_def_property_ui_text(prop, "Effector Weights", "");
262
prop = RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
263
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
264
RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness");
265
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
267
prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
268
RNA_def_property_float_sdna(prop, NULL, "time_scale");
269
RNA_def_property_range(prop, 0.2, 1.5);
270
RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
271
RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
272
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
274
prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
275
RNA_def_property_float_sdna(prop, NULL, "vorticity");
276
RNA_def_property_range(prop, 0.01, 4.0);
277
RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
278
RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid");
279
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
252
283
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
259
290
RNA_def_struct_sdna(srna, "SmokeFlowSettings");
260
291
RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path");
262
prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
293
prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
263
294
RNA_def_property_float_sdna(prop, NULL, "density");
264
295
RNA_def_property_range(prop, 0.001, 1);
265
296
RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
266
297
RNA_def_property_ui_text(prop, "Density", "");
267
RNA_def_property_update(prop, 0, NULL); // NC_OBJECT|ND_MODIFIER
298
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
269
prop= RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
300
prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
270
301
RNA_def_property_float_sdna(prop, NULL, "temp");
271
302
RNA_def_property_range(prop, -10, 10);
272
303
RNA_def_property_ui_range(prop, -10, 10, 1, 1);
273
304
RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
274
RNA_def_property_update(prop, 0, NULL);
305
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
276
prop= RNA_def_property(srna, "psys", PROP_POINTER, PROP_NONE);
307
prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
277
308
RNA_def_property_pointer_sdna(prop, NULL, "psys");
278
309
RNA_def_property_struct_type(prop, "ParticleSystem");
279
310
RNA_def_property_flag(prop, PROP_EDITABLE);
280
311
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
281
312
RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy");
283
prop= RNA_def_property(srna, "outflow", PROP_BOOLEAN, PROP_NONE);
314
prop = RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
284
315
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
285
RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
286
RNA_def_property_update(prop, 0, NULL);
316
RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation");
317
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
319
prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
320
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
321
RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area");
322
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
324
prop = RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
325
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
326
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle");
327
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
329
prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
330
RNA_def_property_float_sdna(prop, NULL, "vel_multi");
331
RNA_def_property_range(prop, -2.0, 2.0);
332
RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
333
RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke");
334
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
289
337
static void rna_def_smoke_coll_settings(BlenderRNA *brna)