Changed the particle physics "timetweak" value to a more descriptive "timestep" value...
authorJanne Karhu <jhkarh@gmail.com>
Mon, 21 Mar 2011 10:53:29 +0000 (10:53 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Mon, 21 Mar 2011 10:53:29 +0000 (10:53 +0000)
* Done purely in rna, internally particles still use the timetweak value.

release/scripts/ui/properties_particle.py
source/blender/makesrna/intern/rna_particle.c

index 8201daacc4f38e56a64113fdc116a95d5fb96e25..f67040d6a8714fab6fa5d3c3d1de4c01affd5df3 100644 (file)
@@ -474,7 +474,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel):
             col = split.column()
             col.label(text="Integration:")
             col.prop(part, "integrator", text="")
-            col.prop(part, "time_tweak")
+            col.prop(part, "timestep")
             col.prop(part, "subframes")
 
             row = layout.row()
index 069f674bf4a9a3be3f7c0f7ae9e2221ab302885b..73030b00328a262a185b62cddbc19b88c3d38e75 100644 (file)
@@ -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);