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-20 04:33:59 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2009-08-20 04:33:59 +0400
commit286c2ca80be4ae46dc220ada2fcc5bf636d5ff49 (patch)
tree91492852f1b0f8d6bc70d8b88113325e218e7f9d /source/blender/makesrna/intern/rna_smoke.c
parentc21627e31b0e82f28e35af51cec681897285ff78 (diff)
Smoke:
* cache for low res (deactivating high res for now) * new way of view3d rendering of smoke (no longer 3 axes) -using 3dtexture now (introduced into gpu/intern) * introducing LZO and LZMA libs into extern (makefiles missing for now) * reducing memory usage after simulating for the frame ended (freeing temporary buffers) * splitting smoke into 2 modifier for the cache-sake (it cannot handle more than 1 cache on the same modifier-index) * no color on gui anymore * fixing non-power-of-2 resolutions (hopefully) * fixing select-deselect of domain drawing bug * fixing drawobject.c coding style (making Ton happy) ;-) HINT #1: If scons doesn't work -> cmakefiles are up-to-date, couldn't test scons (but i tried to mantain them, too) CODERS HINT #1: we really need a way to disable adding all modifiers through "Add Modifiers" dropdown! WARNING #1: before applying this commit, deactivate your SMOKE DOMAIN in your old files and save them then. You can open them then savely after that. WARNING #2: File and cache format of smoke can be changed, this is not final!
Diffstat (limited to 'source/blender/makesrna/intern/rna_smoke.c')
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c85
1 files changed, 30 insertions, 55 deletions
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 6f1babb495a..a119eefa62c 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -78,11 +78,28 @@ 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;
- settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE;
+ // settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE;
}
static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
@@ -116,14 +133,6 @@ 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");
@@ -136,56 +145,19 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
- prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "omega");
- RNA_def_property_range(prop, 0.02, 1.0);
- RNA_def_property_ui_range(prop, 0.02, 1.0, 0.02, 2);
- RNA_def_property_ui_text(prop, "Color", "Smoke color (0 = black, 1 = white).");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Smoke_redraw");
-
- 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, "highres", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES);
- RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification).");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset");
-
- prop= RNA_def_property(srna, "viewhighres", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_USEBIG);
- RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification).");
- RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_redraw");
-
- 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, "visibility", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "visibility");
- RNA_def_property_range(prop, 1, 15);
- RNA_def_property_ui_range(prop, 1, 15, 1, 0);
- RNA_def_property_ui_text(prop, "Display", "How much of the resolution should be shown during preview (every 2nd, 3rd, etc).");
- RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Smoke_redraw");
-
prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
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);
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");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
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");
+ RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "coll_group");
@@ -208,13 +180,6 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group.");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy");
- 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, "dissolve_speed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "diss_speed");
RNA_def_property_range(prop, 1.0, 100.0);
@@ -222,6 +187,11 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed");
RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL);
+ 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");
+
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.");
@@ -231,6 +201,11 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
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);
+
+ 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_smoke_flow_settings(BlenderRNA *brna)