2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-07-30 15:00:26 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-07-30 15:00:26 +00:00
|
|
|
*
|
|
|
|
* Contributor(s): Daniel Genrich
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_smoke.c
|
|
|
|
* \ingroup RNA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-07-30 15:00:26 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
|
|
#include "BKE_modifier.h"
|
|
|
|
#include "BKE_smoke.h"
|
|
|
|
|
|
|
|
#include "DNA_modifier_types.h"
|
2010-10-30 08:51:50 +00:00
|
|
|
#include "DNA_object_force.h"
|
2009-07-30 15:00:26 +00:00
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
#include "DNA_smoke_types.h"
|
|
|
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
#include "BKE_depsgraph.h"
|
|
|
|
#include "BKE_particle.h"
|
|
|
|
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Smoke_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2009-07-30 15:00:26 +00:00
|
|
|
{
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
2009-07-30 15:00:26 +00:00
|
|
|
{
|
2009-12-08 17:23:48 +00:00
|
|
|
rna_Smoke_update(bmain, scene, ptr);
|
2010-08-01 12:47:49 +00:00
|
|
|
DAG_scene_sort(bmain, scene);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
|
2009-07-30 15:00:26 +00:00
|
|
|
{
|
|
|
|
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
|
|
|
|
|
|
|
|
smokeModifier_reset(settings->smd);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (settings->smd && settings->smd->domain)
|
2010-10-30 08:51:50 +00:00
|
|
|
settings->point_cache[0]->flag |= PTCACHE_OUTDATED;
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
rna_Smoke_update(bmain, scene, ptr);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *ptr)
|
2009-07-30 15:00:26 +00:00
|
|
|
{
|
|
|
|
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
|
|
|
|
|
|
|
|
smokeModifier_reset(settings->smd);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (settings->smd && settings->smd->domain)
|
2010-10-30 08:51:50 +00:00
|
|
|
settings->smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED;
|
|
|
|
|
2009-12-08 17:23:48 +00:00
|
|
|
rna_Smoke_dependency_update(bmain, scene, ptr);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ModifierData *md = (ModifierData *)settings->smd;
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("modifiers[\"%s\"].domain_settings", md->name);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ModifierData *md = (ModifierData *)settings->smd;
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("modifiers[\"%s\"].flow_settings", md->name);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static char *rna_SmokeCollSettings_path(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data;
|
2012-03-05 23:30:41 +00:00
|
|
|
ModifierData *md = (ModifierData *)settings->smd;
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2009-11-03 22:07:15 +00:00
|
|
|
return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name);
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
static void rna_def_smoke_domain_settings(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-08-25 21:53:52 +00:00
|
|
|
static EnumPropertyItem prop_noise_type_items[] = {
|
|
|
|
{MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
|
2011-09-05 23:46:08 +00:00
|
|
|
#ifdef WITH_FFTW3
|
2012-03-18 09:27:36 +00:00
|
|
|
{MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
|
2009-08-25 21:53:52 +00:00
|
|
|
#endif
|
|
|
|
/* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
|
|
|
|
2010-01-25 15:10:14 +00:00
|
|
|
static EnumPropertyItem smoke_cache_comp_items[] = {
|
2010-02-11 01:11:52 +00:00
|
|
|
{SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Fast but not so effective compression"},
|
|
|
|
{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
|
2010-01-25 15:10:14 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}};
|
|
|
|
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
static EnumPropertyItem smoke_domain_colli_items[] = {
|
|
|
|
{SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
|
2012-03-18 09:27:36 +00:00
|
|
|
{SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open",
|
|
|
|
"Smoke doesn't collide with top and bottom sides"},
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
{SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
|
|
|
|
2009-07-30 15:00:26 +00:00
|
|
|
srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_struct_sdna(srna, "SmokeDomainSettings");
|
|
|
|
RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "maxres");
|
2009-08-02 23:30:44 +00:00
|
|
|
RNA_def_property_range(prop, 24, 512);
|
|
|
|
RNA_def_property_ui_range(prop, 24, 512, 2, 0);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "amplify");
|
|
|
|
RNA_def_property_range(prop, 1, 10);
|
|
|
|
RNA_def_property_ui_range(prop, 1, 10, 1, 0);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise");
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE);
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)");
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE);
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)");
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noise");
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_type_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution");
|
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "alpha");
|
|
|
|
RNA_def_property_range(prop, -5.0, 5.0);
|
|
|
|
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Density",
|
|
|
|
"How much density affects smoke motion (higher value results in faster rising smoke)");
|
2009-08-25 21:53:52 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "beta");
|
|
|
|
RNA_def_property_range(prop, -5.0, 5.0);
|
|
|
|
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Heat",
|
|
|
|
"How much heat affects smoke motion (higher value results in faster rising smoke)");
|
2009-08-25 21:53:52 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
|
|
|
|
RNA_def_property_struct_type(prop, "Group");
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "fluid_group");
|
|
|
|
RNA_def_property_struct_type(prop, "Group");
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "eff_group");
|
|
|
|
RNA_def_property_struct_type(prop, "Group");
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
|
2009-08-09 01:30:32 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "strength");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 10.0);
|
|
|
|
RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
|
2011-05-11 20:23:55 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Strength", "Strength of noise");
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE);
|
2009-08-12 17:32:02 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
|
2010-08-10 13:06:45 +00:00
|
|
|
RNA_def_property_range(prop, 1.0, 10000.0);
|
|
|
|
RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0);
|
2009-08-12 17:32:02 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
|
2010-11-30 21:31:18 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-08-20 00:33:59 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
|
2009-08-12 17:32:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
|
2010-11-30 21:31:18 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-08-12 17:32:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
|
2009-08-12 17:32:02 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
|
|
|
|
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
|
2010-11-30 21:31:18 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-08-20 00:33:59 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
2009-08-25 23:39:49 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]");
|
2009-08-20 00:33:59 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Point Cache", "");
|
2009-08-25 21:53:52 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE);
|
2010-01-25 15:10:14 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "cache_comp");
|
|
|
|
RNA_def_property_enum_items(prop, smoke_cache_comp_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
|
2010-01-25 15:10:14 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
|
|
|
|
RNA_def_property_enum_items(prop, smoke_domain_colli_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Border Collisions",
|
|
|
|
"Select which domain border will be treated as collision object");
|
2011-08-17 12:52:38 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2010-01-25 15:10:14 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
|
2009-10-08 10:18:14 +00:00
|
|
|
RNA_def_property_struct_type(prop, "EffectorWeights");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_ui_text(prop, "Effector Weights", "");
|
2010-01-25 15:10:14 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
|
2011-09-29 14:41:11 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness");
|
2010-11-30 21:31:18 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "time_scale");
|
|
|
|
RNA_def_property_range(prop, 0.2, 1.5);
|
|
|
|
RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vorticity");
|
|
|
|
RNA_def_property_range(prop, 0.01, 4.0);
|
|
|
|
RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
|
|
|
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "SmokeFlowSettings", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Flow Settings", "Smoke flow settings");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_struct_sdna(srna, "SmokeFlowSettings");
|
|
|
|
RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "density");
|
|
|
|
RNA_def_property_range(prop, 0.001, 1);
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4);
|
|
|
|
RNA_def_property_ui_text(prop, "Density", "");
|
2011-10-20 14:54:22 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "temp");
|
|
|
|
RNA_def_property_range(prop, -10, 10);
|
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 1, 1);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature");
|
2011-10-20 14:54:22 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE);
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "psys");
|
|
|
|
RNA_def_property_struct_type(prop, "ParticleSystem");
|
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object");
|
2009-09-09 18:39:40 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy");
|
2009-07-30 15:00:26 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE);
|
2009-08-02 23:30:44 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
|
2011-09-29 14:41:11 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation");
|
2011-10-20 14:54:22 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
|
2011-09-29 14:41:11 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area");
|
2011-10-20 14:54:22 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
|
2011-10-20 07:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle");
|
2011-10-20 14:54:22 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE);
|
Smoke Patch + additions: a) Applying patch #22765 by Miika Hämäläinen (domain border collision settings, vorticity settings, time scale, non absolute density, smooth high res emitter, initial velocity multiplier, high res strength available to be set to 0), b) Additions by me: --Initial velocity is now per flow object, not per domain; --Using boundingbox as standard display mode for domains (was wire before); --When adding a flow object, an initial nice SmokeParticle system is added too with nice initial settings (life=1, no_render, unborn, etc) fitting smoke simulation; --Adaptive timesteps introduced to the smoke sim (depending on the magnitude of the velocity) because it was quite unstable when used for fire simulations, still needs to be tested and will also slow down some simulations.
2010-07-27 14:53:20 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vel_multi");
|
|
|
|
RNA_def_property_range(prop, -2.0, 2.0);
|
|
|
|
RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5);
|
|
|
|
RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke");
|
2011-10-20 14:54:22 +00:00
|
|
|
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
|
2009-07-30 15:00:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_smoke_coll_settings(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "SmokeCollSettings", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Collision Settings", "Smoke collision settings");
|
2009-07-30 15:00:26 +00:00
|
|
|
RNA_def_struct_sdna(srna, "SmokeCollSettings");
|
|
|
|
RNA_def_struct_path_func(srna, "rna_SmokeCollSettings_path");
|
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_smoke(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
rna_def_smoke_domain_settings(brna);
|
|
|
|
rna_def_smoke_flow_settings(brna);
|
|
|
|
rna_def_smoke_coll_settings(brna);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|