Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/intern/smoke.c207
-rw-r--r--source/blender/blenloader/intern/readfile.c54
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c2
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h24
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c33
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c56
7 files changed, 331 insertions, 47 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 4e299accffc..189cd61d5a8 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -45,7 +45,7 @@ struct Scene;
struct Main;
#define BLENDER_VERSION 253
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 1
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 7424026354a..193512b11dc 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -220,7 +220,7 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive
// printf("res[0]: %d, res[1]: %d, res[2]: %d\n", smd->domain->res[0], smd->domain->res[1], smd->domain->res[2]);
// dt max is 0.1
- smd->domain->fluid = smoke_init(smd->domain->res, smd->domain->p0, 0.1);
+ smd->domain->fluid = smoke_init(smd->domain->res, smd->domain->p0);
smd->time = scene->r.cfra;
if(smd->domain->flags & MOD_SMOKE_HIGHRES)
@@ -237,7 +237,7 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive
if(!smd->domain->shadow)
smd->domain->shadow = MEM_callocN(sizeof(float) * smd->domain->res[0] * smd->domain->res[1] * smd->domain->res[2], "SmokeDomainShadow");
- smoke_initBlenderRNA(smd->domain->fluid, &(smd->domain->alpha), &(smd->domain->beta));
+ smoke_initBlenderRNA(smd->domain->fluid, &(smd->domain->alpha), &(smd->domain->beta), &(smd->domain->time_scale), &(smd->domain->vorticity), &(smd->domain->border_collisions));
if(smd->domain->wt)
{
@@ -713,12 +713,16 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
smd->domain->omega = 1.0;
smd->domain->alpha = -0.001;
smd->domain->beta = 0.1;
- smd->domain->flags = MOD_SMOKE_DISSOLVE_LOG;
+ smd->domain->time_scale = 1.0;
+ smd->domain->vorticity = 2.0;
+ smd->domain->border_collisions = 1; // vertically non-colliding
+ smd->domain->flags = MOD_SMOKE_DISSOLVE_LOG | MOD_SMOKE_HIGH_SMOOTH;
smd->domain->strength = 2.0;
smd->domain->noise = MOD_SMOKE_NOISEWAVE;
smd->domain->diss_speed = 5;
- // init view3d buffer
- smd->domain->viewsettings = 0;
+ // init 3dview buffer
+
+ smd->domain->viewsettings = MOD_SMOKE_VIEW_SHOWBIG;
smd->domain->effector_weights = BKE_add_effector_weights(NULL);
}
else if(smd->type & MOD_SMOKE_TYPE_FLOW)
@@ -733,6 +737,8 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
/* set some standard values */
smd->flow->density = 1.0;
smd->flow->temp = 1.0;
+ smd->flow->flags = MOD_SMOKE_FLOW_ABSOLUTE;
+ smd->flow->vel_multi = 1.0;
smd->flow->psys = NULL;
@@ -862,7 +868,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
{
ParticleSystem *psys = sfs->psys;
ParticleSettings *part=psys->part;
- ParticleData *pa = NULL;
+ ParticleData *pa = NULL;
int p = 0;
float *density = smoke_get_density(sds->fluid);
float *bigdensity = smoke_turbulence_get_density(sds->wt);
@@ -871,7 +877,27 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
float *velocity_y = smoke_get_velocity_y(sds->fluid);
float *velocity_z = smoke_get_velocity_z(sds->fluid);
unsigned char *obstacle = smoke_get_obstacle(sds->fluid);
- int bigres[3];
+ int bigres[3];
+ short absolute_flow = (sfs->flags & MOD_SMOKE_FLOW_ABSOLUTE);
+ short high_emission_smoothing = bigdensity ? (smd->domain->flags & MOD_SMOKE_HIGH_SMOOTH) : 0;
+
+ /*
+ * A temporary volume map used to store whole emissive
+ * area to be added to smoke density and interpolated
+ * for high resolution smoke.
+ */
+ float *temp_emission_map = NULL;
+
+ // initialize temp emission map
+ if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW))
+ {
+ int i;
+ temp_emission_map = MEM_callocN(sizeof(float) * sds->res[0]*sds->res[1]*sds->res[2], "SmokeTempEmission");
+ // set whole volume to 0.0f
+ for (i=0; i<sds->res[0]*sds->res[1]*sds->res[2]; i++) {
+ temp_emission_map[i] = 0.0f;
+ }
+ }
// mostly copied from particle code
for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++)
@@ -905,33 +931,21 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
// heat[index] += sfs->temp * 0.1;
// density[index] += sfs->density * 0.1;
heat[index] = sfs->temp;
- density[index] = sfs->density;
+
+ // Add emitter density to temp emission map
+ temp_emission_map[index] = sfs->density;
// Uses particle velocity as initial velocity for smoke
- if(smd->domain->flags & MOD_SMOKE_INITVELOCITY) {
- velocity_x[index] = pa->state.vel[0];
- velocity_y[index] = pa->state.vel[1];
- velocity_z[index] = pa->state.vel[2];
- }
-
- // obstacle[index] |= 2;
- // we need different handling for the high-res feature
- if(bigdensity)
- {
- // init all surrounding cells according to amplification, too
- int i, j, k;
+ if(sfs->flags & MOD_SMOKE_FLOW_INITVELOCITY) {
- smoke_turbulence_get_res(smd->domain->wt, bigres);
+ velocity_x[index] = pa->state.vel[0]*sfs->vel_multi;
+ velocity_y[index] = pa->state.vel[1]*sfs->vel_multi;
+ velocity_z[index] = pa->state.vel[2]*sfs->vel_multi;
+
+ }
+
- for(i = 0; i < smd->domain->amplify + 1; i++)
- for(j = 0; j < smd->domain->amplify + 1; j++)
- for(k = 0; k < smd->domain->amplify + 1; k++)
- {
- index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k);
- bigdensity[index] = sfs->density;
- }
- }
}
else if(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) // outflow
{
@@ -954,9 +968,136 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k);
bigdensity[index] = 0.f;
}
- }
- } // particles loop
- }
+ }
+ }
+ } // particles loop
+
+
+ // apply emission values
+ if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW)) {
+
+ // initialize variables
+ int ii, jj, kk, x, y, z, block_size;
+ size_t index, index_big;
+
+ smoke_turbulence_get_res(smd->domain->wt, bigres);
+ block_size = smd->domain->amplify + 1; // high res block size
+
+
+ // loop through every low res cell
+ for(x = 0; x < sds->res[0]; x++)
+ for(y = 0; y < sds->res[1]; y++)
+ for(z = 0; z < sds->res[2]; z++)
+ {
+
+ // neighbour cell emission densities (for high resolution smoke smooth interpolation)
+ float c000, c001, c010, c011, c100, c101, c110, c111;
+
+ c000 = (x>0 && y>0 && z>0) ? temp_emission_map[smoke_get_index(x-1, sds->res[0], y-1, sds->res[1], z-1)] : 0;
+ c001 = (x>0 && y>0) ? temp_emission_map[smoke_get_index(x-1, sds->res[0], y-1, sds->res[1], z)] : 0;
+ c010 = (x>0 && z>0) ? temp_emission_map[smoke_get_index(x-1, sds->res[0], y, sds->res[1], z-1)] : 0;
+ c011 = (x>0) ? temp_emission_map[smoke_get_index(x-1, sds->res[0], y, sds->res[1], z)] : 0;
+
+ c100 = (y>0 && z>0) ? temp_emission_map[smoke_get_index(x, sds->res[0], y-1, sds->res[1], z-1)] : 0;
+ c101 = (y>0) ? temp_emission_map[smoke_get_index(x, sds->res[0], y-1, sds->res[1], z)] : 0;
+ c110 = (z>0) ? temp_emission_map[smoke_get_index(x, sds->res[0], y, sds->res[1], z-1)] : 0;
+ c111 = temp_emission_map[smoke_get_index(x, sds->res[0], y, sds->res[1], z)]; // this cell
+
+
+
+ // get cell index
+ index = smoke_get_index(x, sds->res[0], y, sds->res[1], z);
+
+ // add emission to low resolution density
+ if (absolute_flow) {if (temp_emission_map[index]>0) density[index] = temp_emission_map[index];}
+ else {
+ density[index] += temp_emission_map[index];
+ if (density[index]>1) density[index]=1.0f;
+ }
+
+ smoke_turbulence_get_res(smd->domain->wt, bigres);
+
+
+
+ /*
+ loop through high res blocks if high res enabled
+ */
+ if (bigdensity)
+ for(ii = 0; ii < block_size; ii++)
+ for(jj = 0; jj < block_size; jj++)
+ for(kk = 0; kk < block_size; kk++)
+ {
+
+ float fx,fy,fz, interpolated_value;
+ int shift_x, shift_y, shift_z;
+
+
+ /*
+ * Do volume interpolation if emitter smoothing
+ * is enabled
+ */
+ if (high_emission_smoothing) {
+ // convert block position to relative
+ // for interpolation smoothing
+ fx = (float)ii/block_size + 0.5f/block_size;
+ fy = (float)jj/block_size + 0.5f/block_size;
+ fz = (float)kk/block_size + 0.5f/block_size;
+
+ // calculate trilinear interpolation
+ interpolated_value = c000 * (1-fx) * (1-fy) * (1-fz) +
+ c100 * fx * (1-fy) * (1-fz) +
+ c010 * (1-fx) * fy * (1-fz) +
+ c001 * (1-fx) * (1-fy) * fz +
+ c101 * fx * (1-fy) * fz +
+ c011 * (1-fx) * fy * fz +
+ c110 * fx * fy * (1-fz) +
+ c111 * fx * fy * fz;
+
+
+ // add some contrast / sharpness
+ // depending on hi-res block size
+
+ interpolated_value = (interpolated_value-0.4f*sfs->density)*(block_size/2) + 0.4f*sfs->density;
+ if (interpolated_value<0.0f) interpolated_value = 0.0f;
+ if (interpolated_value>1.0f) interpolated_value = 1.0f;
+
+ // shift smoke block index
+ // (because pixel center is actually
+ // in halfway of the low res block)
+ shift_x = (x < 1) ? 0 : block_size/2;
+ shift_y = (y < 1) ? 0 : block_size/2;
+ shift_z = (z < 1) ? 0 : block_size/2;
+ }
+ else {
+ // without interpolation use same low resolution
+ // block value for all hi-res blocks
+ interpolated_value = c111;
+ shift_x = 0;
+ shift_y = 0;
+ shift_z = 0;
+ }
+
+ // get shifted index for current high resolution block
+ index_big = smoke_get_index(block_size * x + ii - shift_x, bigres[0], block_size * y + jj - shift_y, bigres[1], block_size * z + kk - shift_z);
+
+ // add emission data to high resolution density
+ if (absolute_flow) {if (interpolated_value > 0) bigdensity[index_big] = interpolated_value;}
+ else {
+ bigdensity[index_big] += interpolated_value;
+ if (bigdensity[index_big]>1) bigdensity[index_big]=1.0f;
+ }
+
+ } // end of hires loop
+
+ } // end of low res loop
+
+ // free temporary emission map
+ if (temp_emission_map) MEM_freeN(temp_emission_map);
+
+ } // end emission
+
+
+
}
else
{
@@ -970,7 +1111,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
BLI_bvhtree_find_nearest(sfs->bvh->tree, pco, &nearest, sfs->bvh->nearest_callback, sfs->bvh);
}*/
- }
+ }
}
}
if(sds->fluid_group)
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 71a9fc2e844..3227d4b25bb 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11066,6 +11066,60 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ if (main->versionfile < 253 || (main->versionfile == 253 && main->subversionfile < 1))
+ {
+ Object *ob;
+
+ for(ob = main->object.first; ob; ob = ob->id.next) {
+ ModifierData *md;
+ for(md= ob->modifiers.first; md; md= md->next) {
+ if (md->type == eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+
+ if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
+ {
+ GroupObject *go = NULL;
+ Base *base = NULL;
+ Scene *scene = NULL;
+
+ smd->domain->vorticity = 2.0f;
+ smd->domain->time_scale = 1.0f;
+
+ if(!(smd->domain->flags & (1<<4)))
+ continue;
+
+ /* delete old MOD_SMOKE_INITVELOCITY flag */
+ smd->domain->flags &= ~(1<<4);
+
+ /* for now just add it to all flow objects in the scene */
+ {
+ Object *ob2;
+ for(ob2 = main->object.first; ob2; ob2 = ob2->id.next) {
+ ModifierData *md2;
+ for(md2= ob2->modifiers.first; md2; md2= md2->next) {
+ if (md2->type == eModifierType_Smoke) {
+ SmokeModifierData *smd2 = (SmokeModifierData *)md2;
+
+ if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow)
+ {
+ smd2->flow->flags |= MOD_SMOKE_FLOW_INITVELOCITY;
+ }
+ }
+ }
+ }
+ }
+
+ }
+ else if((smd->type & MOD_SMOKE_TYPE_FLOW) && smd->flow)
+ {
+ smd->flow->vel_multi = 1.0f;
+ }
+
+ }
+ }
+ }
+ }
+
/* put compatibility code here until next subversion bump */
{
}
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 420f2d77fed..79b22f41e30 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -450,7 +450,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture
}
tend();
- printf ( "Draw Time: %f\n",( float ) tval() );
+ // printf ( "Draw Time: %f\n",( float ) tval() );
if(tex_shadow)
GPU_texture_unbind(tex_shadow);
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 46e5c10be3b..b8be51b378f 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -33,8 +33,8 @@
#define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */
#define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */
#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */
-#define MOD_SMOKE_INITVELOCITY (1<<4) /* passes particles speed to
- the smoke*/
+
+#define MOD_SMOKE_HIGH_SMOOTH (1<<5) /* smoothens high res emission*/
/* noise */
#define MOD_SMOKE_NOISEWAVE (1<<0)
@@ -47,6 +47,11 @@
#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
+
typedef struct SmokeDomainSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
struct FLUID_3D *fluid;
@@ -84,6 +89,10 @@ typedef struct SmokeDomainSettings {
struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */
struct ListBase ptcaches[2];
struct EffectorWeights *effector_weights;
+ int border_collisions; /* How domain border collisions are handled */
+ float time_scale;
+ float vorticity;
+ int pad2;
} SmokeDomainSettings;
@@ -92,18 +101,25 @@ typedef struct SmokeDomainSettings {
/* type */
#define MOD_SMOKE_FLOW_TYPE_OUTFLOW (1<<1)
+/* flags */
+#define MOD_SMOKE_FLOW_ABSOLUTE (1<<1) /*old style emission*/
+#define MOD_SMOKE_FLOW_INITVELOCITY (1<<2) /* passes particles speed to
+ the smoke*/
+
+
typedef struct SmokeFlowSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
struct ParticleSystem *psys;
float density;
float temp; /* delta temperature (temp - ambient temp) */
- float velocity[3]; /* UNUSED, velocity taken from particles */
+ float velocity[2]; /* UNUSED, velocity taken from particles */
+ float vel_multi; // Multiplier for particle velocity
float vgrp_heat_scale[2]; /* min and max scaling for vgroup_heat */
short vgroup_flow; /* where inflow/outflow happens - red=1=action */
short vgroup_density;
short vgroup_heat;
short type; /* inflow =0 or outflow = 1 */
- int pad;
+ int flags; /* absolute emission etc*/
} SmokeFlowSettings;
/*
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index dfd9c2f434c..dcf20a3531d 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -87,10 +87,15 @@ EnumPropertyItem modifier_type_items[] ={
#ifdef RNA_RUNTIME
+#include "DNA_particle_types.h"
+#include "DNA_smoke_types.h"
+
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_library.h"
#include "BKE_modifier.h"
+#include "BKE_particle.h"
+#include "BKE_pointcache.h"
static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
@@ -216,6 +221,9 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SmokeModifierData *smd= (SmokeModifierData *)ptr->data;
Object *ob= (Object*)ptr->id.data;
+ ParticleSystemModifierData *psmd = NULL;
+ ParticleSystem *psys = NULL;
+ ParticleSettings *part = NULL;
// nothing changed
if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain)
@@ -226,9 +234,32 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
switch (smd->type) {
case MOD_SMOKE_TYPE_DOMAIN:
- ob->dt = OB_WIRE;
+ ob->dt = OB_BOUNDBOX;
break;
case MOD_SMOKE_TYPE_FLOW:
+ for(psys=ob->particlesystem.first; psys; psys=psys->next)
+ if(psys->part->type == PART_EMITTER)
+ break;
+ if(ob->type == OB_MESH && !psys) {
+ /* add particle system */
+ psmd = object_add_particle_system(scene, ob, NULL);
+ if(psmd)
+ {
+ psys = psmd->psys;
+ part = psys->part;
+ part->flag |= PART_UNBORN;
+ part->lifetime = 1.0f;
+ part->sta = 1.0f;
+ part->end = 250.0f;
+ part->ren_as = PART_DRAW_NOT;
+ part->phystype = PART_PHYS_NO;
+ sprintf(psys->name, "SmokeParticles");
+ psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA);
+ }
+ }
+ if(smd->flow)
+ smd->flow->psys = psys;
case MOD_SMOKE_TYPE_COLL:
case 0:
default:
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index d4ff98e9701..56049ea15ce 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -120,6 +120,12 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
{SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem smoke_domain_colli_items[] = {
+ {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"},
+ {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", "Smoke doesn't collide with top and bottom sides"},
+ {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"},
+ {0, NULL, 0, NULL, NULL}};
+
srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL);
RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings");
RNA_def_struct_sdna(srna, "SmokeDomainSettings");
@@ -192,8 +198,8 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
- RNA_def_property_range(prop, 1.0, 10.0);
- RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2);
+ RNA_def_property_range(prop, 0.0, 10.0);
+ RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2);
RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
@@ -204,11 +210,6 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
RNA_def_property_update(prop, 0, NULL);
- prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_INITVELOCITY);
- RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
- RNA_def_property_update(prop, 0, NULL);
-
prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE);
RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time");
@@ -241,12 +242,36 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
RNA_def_property_update(prop, 0, NULL);
+ prop= RNA_def_property(srna, "smoke_domain_colli", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "border_collisions");
+ RNA_def_property_enum_items(prop, smoke_domain_colli_items);
+ RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used");
+ RNA_def_property_update(prop, 0, NULL);
prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "EffectorWeights");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Effector Weights", "");
+ prop= RNA_def_property(srna, "smoothemitter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH);
+ RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness.");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE);
+ 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);
+ RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE);
+ 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);
+ RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
}
static void rna_def_smoke_flow_settings(BlenderRNA *brna)
@@ -284,6 +309,23 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW);
RNA_def_property_ui_text(prop, "Outflow", "Deletes smoke from simulation");
RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE);
+ RNA_def_property_ui_text(prop, "Absolute Density", "Only allows given density value in emitter area.");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY);
+ RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits it's velocity from the emitter particle");
+ RNA_def_property_update(prop, 0, NULL);
+
+ prop= RNA_def_property(srna, "velocity_multiplier", PROP_FLOAT, PROP_NONE);
+ 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");
+ RNA_def_property_update(prop, 0, NULL);
}
static void rna_def_smoke_coll_settings(BlenderRNA *brna)