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:
authorDaniel Genrich <daniel.genrich@gmx.net>2009-08-26 01:53:52 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2009-08-26 01:53:52 +0400
commit6a5773d4a8633374a1f54864c077a0cd5fa122ea (patch)
tree72454f9913ebf63c561f9c9e8ddefbb5190771c0 /source/blender
parentcfcd355c27ba1f923d04dec1f735989b260b190c (diff)
Smoke:
* Deleting high res modifier again * fixing smoke + continue physics drawing * fixing cache reset when changing dissolve
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_smoke.h4
-rw-r--r--source/blender/blenkernel/intern/modifier.c56
-rw-r--r--source/blender/blenkernel/intern/pointcache.c17
-rw-r--r--source/blender/blenkernel/intern/smoke.c47
-rw-r--r--source/blender/blenkernel/intern/smokehighres.c137
-rw-r--r--source/blender/editors/object/object_modifier.c7
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c10
-rw-r--r--source/blender/editors/space_view3d/drawobject.c7
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h29
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h17
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c62
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c82
13 files changed, 106 insertions, 370 deletions
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h
index bd8581112f8..fddcf0fea83 100644
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -40,9 +40,5 @@ void smokeModifier_free (struct SmokeModifierData *smd);
void smokeModifier_reset(struct SmokeModifierData *smd);
void smokeModifier_createType(struct SmokeModifierData *smd);
-// high res modifier
-void smokeHRModifier_do(struct SmokeHRModifierData *shrmd, struct Scene *scene, struct Object *ob, int useRenderParams, int isFinalCalc);
-void smokeHRModifier_free(struct SmokeHRModifierData *shrmd);
-
#endif /* BKE_SMOKE_H_ */
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index c78227a363f..7a0eb882083 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -5879,50 +5879,6 @@ static void smokeModifier_updateDepgraph(
*/
}
-
-/* Smoke High Resolution */
-
-static void smokeHRModifier_initData(ModifierData *md)
-{
- SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md;
-
- shrmd->wt = NULL;
- shrmd->time = -1;
- shrmd->strength = 2.0f;
- shrmd->amplify = 1;
- shrmd->noise = MOD_SMOKE_NOISEWAVE;
- shrmd->point_cache = BKE_ptcache_add(&shrmd->ptcaches);
- shrmd->point_cache->flag |= PTCACHE_DISK_CACHE;
- shrmd->point_cache->step = 1;
-}
-
-static void smokeHRModifier_freeData(ModifierData *md)
-{
- SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md;
-
- smokeHRModifier_free (shrmd);
-}
-
-static void smokeHRModifier_deformVerts(
- ModifierData *md, Object *ob, DerivedMesh *derivedData,
- float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
-{
- SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md;
- smokeHRModifier_do(shrmd, md->scene, ob, useRenderParams, isFinalCalc);
-}
-
-static int smokeHRModifier_dependsOnTime(ModifierData *md)
-{
- return 1;
-}
-
-static void smokeHRModifier_updateDepgraph(
- ModifierData *md, DagForest *forest, Scene *scene, Object *ob,
- DagNode *obNode)
-{
- ;
-}
-
/* Cloth */
static void clothModifier_initData(ModifierData *md)
@@ -8624,18 +8580,6 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
mti->deformVerts = smokeModifier_deformVerts;
mti->dependsOnTime = smokeModifier_dependsOnTime;
mti->updateDepgraph = smokeModifier_updateDepgraph;
-
- mti = INIT_TYPE(SmokeHR);
- mti->type = eModifierTypeType_OnlyDeform;
- mti->initData = smokeHRModifier_initData;
- mti->freeData = smokeHRModifier_freeData;
- mti->flags = eModifierTypeFlag_AcceptsMesh
- | eModifierTypeFlag_UsesPointCache
- | eModifierTypeFlag_Single
- | eModifierTypeFlag_NoUserAdd;
- mti->deformVerts = smokeHRModifier_deformVerts;
- mti->dependsOnTime = smokeHRModifier_dependsOnTime;
- mti->updateDepgraph = smokeHRModifier_updateDepgraph;
mti = INIT_TYPE(Cloth);
mti->type = eModifierTypeType_Nonconstructive;
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 4110570760f..d9740091912 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -479,23 +479,6 @@ static int ptcache_totpoint_smoke(void *smoke_v)
return 0;
}
-static int ptcache_totpoint_smoke_turbulence(void *smoke_v)
-{
- SmokeHRModifierData *shrmd= (SmokeHRModifierData *)smoke_v;
-
- if(shrmd->wt) {
- /*
- unsigned int res[3];
-
- smoke_turbulence_get_res(sds->wt, res);
- return res[0]*res[1]*res[2];
- */
- return 0;
- }
- else
- return 0;
-}
-
// forward decleration
static int ptcache_file_write(PTCacheFile *pf, void *f, size_t tot, int size);
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 7af67364bc5..28d1c264376 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -213,6 +213,14 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive
smd->time = scene->r.cfra;
smd->domain->firstframe = smd->time;
+ /*
+ if(!smd->domain->wt)
+ {
+ smd->domain->wt = smoke_turbulence_init(sds->res, smd->domain->amplify + 1, smd->domain->noise);
+ smoke_turbulence_initBlenderRNA(smd->domain->wt, &smd->domain->strength);
+ }
+ */
+
if(!smd->domain->view3d)
{
// TVox is for transparency
@@ -518,6 +526,9 @@ void smokeModifier_freeDomain(SmokeModifierData *smd)
if(smd->domain->fluid)
smoke_free(smd->domain->fluid);
+ if(smd->domain->wt)
+ smoke_turbulence_free(smd->domain->wt);
+
BKE_ptcache_free_list(&smd->domain->ptcaches);
smd->domain->point_cache = NULL;
@@ -585,6 +596,12 @@ void smokeModifier_reset(struct SmokeModifierData *smd)
smoke_free(smd->domain->fluid);
smd->domain->fluid = NULL;
}
+
+ if(smd->domain->wt)
+ {
+ smoke_turbulence_free(smd->domain->wt);
+ smd->domain->wt = NULL;
+ }
smd->domain->point_cache->flag &= ~PTCACHE_SIMULATION_VALID;
smd->domain->point_cache->flag |= PTCACHE_OUTDATED;
@@ -663,6 +680,10 @@ void smokeModifier_createType(struct SmokeModifierData *smd)
smd->domain->beta = 0.1;
smd->domain->flags = MOD_SMOKE_DISSOLVE_LOG;
smd->domain->diss_speed = 5;
+ smd->domain->strength = 2.0f;
+ smd->domain->amplify = 1;
+ smd->domain->noise = MOD_SMOKE_NOISEWAVE;
+ smd->domain->wt = NULL;
// init 3dview buffer
smd->domain->view3d = NULL;
@@ -783,6 +804,28 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
smoke_simulate_domain(smd, scene, ob, dm);
+ {
+ // float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg
+ Base *base_tmp = NULL;
+
+ for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next)
+ {
+ if(base_tmp->object->type == OB_LAMP)
+ {
+ Lamp *la = (Lamp *)base_tmp->object->data;
+
+ if(la->type == LA_LOCAL)
+ {
+ VECCOPY(light, base_tmp->object->obmat[3]);
+ have_lamp = 1;
+ break;
+ }
+ }
+ }
+ }
+
+ smoke_prepare_View(smd, (float)framenr, light, have_lamp);
+
return;
}
@@ -885,11 +928,11 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
BKE_ptcache_write_cache(&pid, framenr);
- // printf("Writing cache_low\n");
+ // printf("Writing cache_low, %d\n", framenr);
tend();
- printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() );
+ // printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() );
}
}
diff --git a/source/blender/blenkernel/intern/smokehighres.c b/source/blender/blenkernel/intern/smokehighres.c
deleted file mode 100644
index 6a2e0549158..00000000000
--- a/source/blender/blenkernel/intern/smokehighres.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * smokehighres.c
- *
- * $Id$
- *
- * ***** 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,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Daniel Genrich
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/* Part of the code copied from elbeem fluid library, copyright by Nils Thuerey */
-
-#include "DNA_scene_types.h"
-#include "DNA_listBase.h"
-#include "DNA_modifier_types.h"
-#include "DNA_object_types.h"
-#include "DNA_smoke_types.h"
-
-#include "BKE_modifier.h"
-#include "BKE_smoke.h"
-#include "BKE_pointcache.h"
-
-#include "smoke_API.h"
-
-// we need different handling for the high-res feature
-/*
-if(bigdensity)
-{
- // init all surrounding cells according to amplification, too
- int i, j, k;
-
- smoke_turbulence_get_res(smd->domain->wt, bigres);
-
- 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;
- }
-}
-*/
-
-static void smokeHRinit(SmokeHRModifierData *shrmd, SmokeDomainSettings *sds)
-{
- if(!shrmd->wt)
- {
- shrmd->wt = smoke_turbulence_init(sds->res, shrmd->amplify + 1, shrmd->noise);
- smoke_turbulence_initBlenderRNA(shrmd->wt, &shrmd->strength);
- }
-}
-
-void smokeHRModifier_free(SmokeHRModifierData *shrmd)
-{
- if(shrmd->wt)
- smoke_turbulence_free(shrmd->wt);
-
- BKE_ptcache_free_list(&shrmd->ptcaches);
- shrmd->point_cache = NULL;
-}
-
-void smokeHRModifier_do(SmokeHRModifierData *shrmd, Scene *scene, Object *ob, int useRenderParams, int isFinalCalc)
-{
- ModifierData *md = NULL;
- SmokeModifierData *smd = NULL;
- SmokeDomainSettings *sds = NULL;
-
- // find underlaying smoke domain
- smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke);
- if(!(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN))
- return;
-
- sds = smd->domain;
-
- smokeHRinit(shrmd, sds);
-
- // smoke_turbulence_dissolve(shrmd->wt, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG);
-
- // smoke_turbulence_step(shrmd->wt, sds->fluid);
-}
-
-
-// update necessary information for 3dview ("high res" option)
-void smoke_prepare_bigView(SmokeHRModifierData *shrmd, float *light)
-{
- float *density = NULL;
- size_t i = 0;
- int bigres[3];
-/*
- smoke_turbulence_get_res(shrmd->wt, bigres);
-
- if(!smd->domain->traybig)
- {
- // TRay is for self shadowing
- smd->domain->traybig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tRayBig");
- }
- if(!smd->domain->tvoxbig)
- {
- // TVox is for tranaparency
- smd->domain->tvoxbig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tVoxBig");
- }
-
- density = smoke_turbulence_get_density(smd->domain->wt);
- for (i = 0; i < bigres[0] * bigres[1] * bigres[2]; i++)
- {
- // Transparency computation
- // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4
- // T_vox = exp(-C_ext * h)
- // C_ext/sigma_t = density * C_ext
- smoke_set_bigtvox(smd, i, exp(-density[i] * 7.0 * smd->domain->dx / (smd->domain->amplify + 1)) );
- }
- smoke_calc_transparency(smd, light, 1);
- */
-}
-
-
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index ec46cea8e84..0b8fedd2eda 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -164,13 +164,6 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod
DAG_scene_sort(scene);
}
- else if(md->type == eModifierType_Smoke) {
- ModifierData *tmd = modifiers_findByType(ob, eModifierType_SmokeHR);
- if(tmd) {
- BLI_remlink(&ob->modifiers, tmd);
- modifier_free(tmd);
- }
- }
BLI_remlink(&ob->modifiers, md);
modifier_free(md);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 994bb0010d8..8306487013a 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -697,16 +697,6 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
}
- else if(CTX_data_equals(member, "smoke_hr")) {
- PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
-
- if(ptr && ptr->data) {
- Object *ob= ptr->data;
- ModifierData *md= modifiers_findByType(ob, eModifierType_SmokeHR);
- CTX_data_pointer_set(result, &ob->id, &RNA_SmokeHRModifier, md);
- return 1;
- }
- }
else if(CTX_data_equals(member, "collision")) {
PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 9fc9bf94cd7..bcb962bdcd7 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5312,12 +5312,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
}
/* draw code for smoke */
- if(((SmokeHRModifierData *)(md = modifiers_findByType(ob, eModifierType_SmokeHR)) && (((SmokeHRModifierData *)md)->flags & MOD_SMOKE_SHOWHIGHRES))) {
- // GPU_create_smoke(smd);
- // draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->res);
- // GPU_free_smoke(smd);
- }
- else {
+ {
md = modifiers_findByType(ob, eModifierType_Smoke);
if (md) {
SmokeModifierData *smd = (SmokeModifierData *)md;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index a4587c34e89..be7452c4ae1 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -42,7 +42,6 @@ typedef enum ModifierType {
eModifierType_Multires,
eModifierType_Surface,
eModifierType_Smoke,
- eModifierType_SmokeHR,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -255,34 +254,6 @@ typedef struct SmokeModifierData {
int type; /* domain, inflow, outflow, ... */
} SmokeModifierData;
-
-/* noise */
-#define MOD_SMOKE_NOISEWAVE (1<<0)
-#define MOD_SMOKE_NOISEFFT (1<<1)
-#define MOD_SMOKE_NOISECURL (1<<2)
-
-/* flags */
-#define MOD_SMOKE_SHOWHIGHRES (1<<0) /* show high resolution */
-
-typedef struct SmokeHRModifierData {
- ModifierData modifier;
-
- struct WTURBULENCE *wt; // WTURBULENCE object, if active
- struct PointCache *point_cache; /* definition is in DNA_object_force.h */
- struct ListBase ptcaches;
- struct GPUTexture *tex;
- float *view3d; /* voxel data for display */
- unsigned int v3dnum; /* number of frame in view3d buffer */
- float time;
- float strength;
- int res[3];
- int maxres;
- short noise; /* noise type: wave, curl, anisotropic */
- short pad;
- int amplify;
- int flags;
-} SmokeHRModifierData;
-
typedef struct DisplaceModifierData {
ModifierData modifier;
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 2d8b21b86de..542281e1960 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -32,10 +32,15 @@
/* flags */
#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_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve *
+
+/* noise */
+#define MOD_SMOKE_NOISEWAVE (1<<0)
+#define MOD_SMOKE_NOISEFFT (1<<1)
+#define MOD_SMOKE_NOISECURL (1<<2)
/* viewsettings */
-/* nothing so far */
+#define MOD_SMOKE_SHOWHIGHRES (1<<0) /* show high resolution */
typedef struct SmokeDomainSettings {
struct SmokeModifierData *smd; /* for fast RNA access */
@@ -64,6 +69,14 @@ typedef struct SmokeDomainSettings {
int diss_speed;/* in frames */
struct PointCache *point_cache; /* definition is in DNA_object_force.h */
struct ListBase ptcaches;
+ struct WTURBULENCE *wt; // WTURBULENCE object, if active
+ int pad3;
+ float strength;
+ int res_wt[3];
+ int maxres_wt;
+ short noise; /* noise type: wave, curl, anisotropic */
+ short pad2;
+ int amplify;
} SmokeDomainSettings;
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index cb54fe2ad8d..ea7451ee77a 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -389,7 +389,6 @@ extern StructRNA RNA_SmokeCollSettings;
extern StructRNA RNA_SmokeDomainSettings;
extern StructRNA RNA_SmokeFlowSettings;
extern StructRNA RNA_SmokeModifier;
-extern StructRNA RNA_SmokeHRModifier;
extern StructRNA RNA_SmoothModifier;
extern StructRNA RNA_SoftBodyModifier;
extern StructRNA RNA_SoftBodySettings;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 4845ad28d47..bb073d19a46 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -75,7 +75,6 @@ EnumPropertyItem modifier_type_items[] ={
{eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""},
{eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""},
{eModifierType_Smoke, "SMOKE", 0, "Smoke", ""},
- {eModifierType_SmokeHR, "SMOKE_HR", 0, "SmokeHR", ""},
{eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
{eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""},
{0, NULL, 0, NULL, NULL}};
@@ -159,8 +158,6 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
return &RNA_SurfaceModifier;
case eModifierType_Smoke:
return &RNA_SmokeModifier;
- case eModifierType_SmokeHR:
- return &RNA_SmokeHRModifier;
default:
return &RNA_Modifier;
}
@@ -201,15 +198,6 @@ static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr)
rna_Modifier_dependency_update(C, ptr);
}
-static void rna_SmokeHR_reset(bContext *C, PointerRNA *ptr)
-{
- // SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
-
- // smokeModifier_reset(settings->smd);
-
- // rna_Smoke_update(C, ptr);
-}
-
static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value)
{
ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data;
@@ -1563,55 +1551,6 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Point Cache", "");
}
-static void rna_def_modifier_smoke_highresolution(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
-
- static EnumPropertyItem prop_noise_type_items[] = {
- {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
-#if FFTW3 == 1
- {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
-#endif
- /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
- {0, NULL, 0, NULL, NULL}};
-
- srna= RNA_def_struct(brna, "SmokeHRModifier", "Modifier");
- RNA_def_struct_ui_text(srna, "Smoke High Resolution Modifier", "Smoke high resolution simulation modifier.");
- RNA_def_struct_sdna(srna, "SmokeHRModifierData");
-
- prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_SHOWHIGHRES);
- RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification).");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
-
- prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
- 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_SmokeHR_reset");
-
- prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
- 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);
- RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset");
-
- 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_ui_text(prop, "Strength", "Strength of wavelet noise");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset");
-
- prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
- RNA_def_property_pointer_sdna(prop, NULL, "point_cache");
- RNA_def_property_struct_type(prop, "PointCache");
- RNA_def_property_ui_text(prop, "Point Cache", "");
-
-}
-
static void rna_def_modifier_smoke(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2028,7 +1967,6 @@ void RNA_def_modifier(BlenderRNA *brna)
rna_def_modifier_multires(brna);
rna_def_modifier_surface(brna);
rna_def_modifier_smoke(brna);
- rna_def_modifier_smoke_highresolution(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 70a5ddf72dd..e671665bd17 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -61,21 +61,6 @@ static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr)
DAG_scene_sort(CTX_data_scene(C));
}
-static void rna_Smoke_reset_cache(bContext *C, PointerRNA *ptr)
-{
- SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
- PointCache *cache = settings->point_cache;
-
- printf("rna_Smoke_reset_cache\n");
-
- cache->flag &= ~PTCACHE_SIMULATION_VALID;
- cache->flag |= PTCACHE_OUTDATED;
- cache->simframe= 0;
- cache->last_exact= 0;
-
- rna_Smoke_update(C, ptr);
-}
-
static void rna_Smoke_reset(bContext *C, PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
@@ -94,23 +79,6 @@ static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr)
rna_Smoke_dependency_update(C, ptr);
}
-static void rna_Smoke_enable_HR(bContext *C, PointerRNA *ptr)
-{
- SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
- Object *ob = (Object*)ptr->id.data;
-
- if(settings->flags & MOD_SMOKE_HIGHRES)
- BLI_addtail(&ob->modifiers, modifier_new(eModifierType_SmokeHR));
- else
- {
- ModifierData *tmd = modifiers_findByType(ob, eModifierType_SmokeHR);
- if(tmd) {
- BLI_remlink(&ob->modifiers, tmd);
- modifier_free(tmd);
- }
- }
-}
-
static void rna_Smoke_redraw(bContext *C, PointerRNA *ptr)
{
SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
@@ -149,6 +117,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
+ static EnumPropertyItem prop_noise_type_items[] = {
+ {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""},
+#if FFTW3 == 1
+ {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""},
+#endif
+ /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */
+ {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");
@@ -166,14 +142,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_range(prop, -5.0, 5.0);
RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5);
RNA_def_property_ui_text(prop, "Gravity", "Higher value results in sinking smoke");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE);
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);
RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
@@ -206,22 +182,54 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
RNA_def_property_ui_text(prop, "High Resolution Smoke", "Enable high resolution smoke");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_enable_HR");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 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.");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG);
RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x ");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "point_cache");
RNA_def_property_struct_type(prop, "PointCache");
RNA_def_property_ui_text(prop, "Point Cache", "");
+
+ prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_SHOWHIGHRES);
+ RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification).");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+
+ prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
+ 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");
+
+ prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE);
+ 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);
+ RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise.");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ 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_ui_text(prop, "Strength", "Strength of wavelet noise");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
+
+ /*
+ prop= RNA_def_property(srna, "point_cache_hr", PROP_POINTER, PROP_NEVER_NULL);
+ RNA_def_property_pointer_sdna(prop, NULL, "point_cache");
+ RNA_def_property_struct_type(prop, "PointCache");
+ RNA_def_property_ui_text(prop, "Point Cache", "");
+ */
}
static void rna_def_smoke_flow_settings(BlenderRNA *brna)