diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-06-12 21:33:38 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-06-19 12:17:02 +0300 |
commit | 9e7012995249281b041d55607e7e7408857aa8c4 (patch) | |
tree | c798c27f235113ed4909fb6e11f68d84653ed8c6 /source/blender/makesrna/intern/rna_object_force.c | |
parent | f382109f3885fc48d7becc526796d3324ab0aa42 (diff) |
Cloth: allow forces to act parallel to cloth.
Currently all force effectors can only act on cloth when the force is
perpendicular to the surface. This makes sense for wind, but not for
other forces; and the user may want even wind to have some friction.
This changes effector code to output two force vectors - although
you of course can pass the same pointer for both. The force is split
between the two outputs based on a new per-effector setting.
Differential Revision: https://developer.blender.org/D8017
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_force.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 30e0ba19608..0a4e714c2ef 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1517,6 +1517,15 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Flow", "Convert effector force into air flow velocity"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); + prop = RNA_def_property(srna, "wind_factor", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "f_wind_factor"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text( + prop, + "Wind Factor", + "How much the force is reduced when acting parallel to a surface, e.g. cloth"); + RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); + /* different ui range to above */ prop = RNA_def_property(srna, "inflow", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_flow"); |