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 00:22:40 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2009-08-26 00:22:40 +0400
commit37144b81784356be71e254148de3ed20db34cf06 (patch)
tree2a3144fb2b46e3304aac414fbff12b9f92a5f37b /source/blender/makesrna/intern/rna_smoke.c
parent0e9f7757b9f1988d3c1ffa86dd48956341e86e9b (diff)
Smoke:
* reset cache when changing heat or gravity
Diffstat (limited to 'source/blender/makesrna/intern/rna_smoke.c')
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index a119eefa62c..70a5ddf72dd 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -46,6 +46,7 @@
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_particle.h"
+#include "BKE_pointcache.h"
#include "ED_object.h"
@@ -60,6 +61,21 @@ 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;
@@ -150,14 +166,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, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache");
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, NULL);
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache");
prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");