diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-05 18:42:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-05 18:42:06 +0400 |
commit | 65377714103259f0629ebfa8124a78364a997745 (patch) | |
tree | f0afdbbbe44e778e0fe97ea7b91cc0203cc0e6d9 | |
parent | a31c0bcc648820d78f1265c116bece378c841561 (diff) |
Simple deform modifier: replace factor property by angle for twist and bend
modes, so we can show degrees rather than radians. Still refers to the same
DNA variable to keep backwards compatibility.
Patch #33807 by Gottfried Hofmann.
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 05e189c86be..66db1352032 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -715,7 +715,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col = split.column() col.label(text="Deform:") - col.prop(md, "factor") + if md.deform_method in {'TAPER', 'STRETCH'}: + col.prop(md, "factor") + else: + col.prop(md, "angle") col.prop(md, "limits", slider=True) if md.deform_method in {'TAPER', 'STRETCH', 'TWIST'}: col.prop(md, "lock_x") diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 810999033a4..9e9c9563c05 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2590,7 +2590,14 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 1, 3); - RNA_def_property_ui_text(prop, "Factor", "Amount to deform object"); + RNA_def_property_ui_text(prop, "Factor", "Amount to deform object."); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "factor"); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -10, 10, 1, 3); + RNA_def_property_ui_text(prop, "Angle", "Angle of deformation."); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE); |