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:
authorJanne Karhu <jhkarh@gmail.com>2011-03-21 13:53:29 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-03-21 13:53:29 +0300
commit28d39473fc65543cbf3adc44964d4a9703d3076a (patch)
tree9721716d7e2a019d392ee9a284696f1a14d1a3ee /source/blender/makesrna/intern/rna_particle.c
parente1a44e9ae6feadff0253a5a086e32187c3f9d756 (diff)
Changed the particle physics "timetweak" value to a more descriptive "timestep" value, which is in seconds.
* Done purely in rna, internally particles still use the timetweak value.
Diffstat (limited to 'source/blender/makesrna/intern/rna_particle.c')
-rw-r--r--source/blender/makesrna/intern/rna_particle.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 069f674bf4a..73030b00328 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -407,6 +407,20 @@ static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value)
settings->end = value;
}
+static void rna_PartSetings_timestep_set(struct PointerRNA *ptr, float value)
+{
+ ParticleSettings *settings = (ParticleSettings*)ptr->data;
+
+ settings->timetweak = value/0.04f;
+}
+
+static float rna_PartSettings_timestep_get(struct PointerRNA *ptr)
+{
+ ParticleSettings *settings = (ParticleSettings*)ptr->data;
+
+ return settings->timetweak * 0.04f;
+}
+
static void rna_PartSetting_hairlength_set(struct PointerRNA *ptr, float value)
{
ParticleSettings *settings = (ParticleSettings*)ptr->data;
@@ -1986,6 +2000,13 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0, 10, 1, 3);
RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
+
+ prop= RNA_def_property(srna, "timestep", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_funcs(prop, "rna_PartSettings_timestep_get", "rna_PartSetings_timestep_set", NULL);
+ RNA_def_property_range(prop, 0.0001, 100.0);
+ RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
+ RNA_def_property_ui_text(prop, "Timestep", "The simulation timestep per frame (in seconds)");
+ RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop= RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);