diff options
author | Pablo Dobarro <pablodp606> | 2022-06-04 05:21:04 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-06-04 23:50:28 +0300 |
commit | e90ba74d3eb826abab4ec65b82fe0176ce3b7d1b (patch) | |
tree | 10f0d095e4aae8c50614b65ba2b71af4bc013002 /source/blender/makesrna | |
parent | e230ccaf8c3b62f8c1a322d525084226136578ba (diff) |
D15041: Sculpt: Elastic Transform
This implements transform modes for the transform tool and Elastic
Transform. This mode uses the Kelvinlets from elastic deform to apply
the transformation to the mesh, using the cursor radius to control the
elasticity falloff.
{F9269771}
In order for this to work, the transform tool uses incremental mode when
elastic transform is enabled. This allows to integrate the displacement of
the Kelvinet in multiple steps.
Review By: Sergey Sharbin & Daniel Bystedt & Julian Kaspar & Campbell
Barton
Differential Revision: https://developer.blender.org/D9653
Ref D15041
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index ab5e4c2f0d5..3de9e632ff6 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -774,6 +774,20 @@ static void rna_def_sculpt(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem sculpt_transform_mode_items[] = { + {SCULPT_TRANSFORM_MODE_ALL_VERTICES, + "ALL_VERTICES", + 0, + "All Vertices", + "Applies the transformation to all vertices in the mesh"}, + {SCULPT_TRANSFORM_MODE_RADIUS_ELASTIC, + "RADIUS_ELASTIC", + 0, + "Elastic", + "Applies the transformation simulating elasticity using the radius of the cursor"}, + {0, NULL, 0, NULL, NULL}, + }; + StructRNA *srna; PropertyRNA *prop; @@ -912,6 +926,12 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + prop = RNA_def_property(srna, "transform_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, sculpt_transform_mode_items); + RNA_def_property_ui_text( + prop, "Transform Mode", "How the transformation is going to be applied to the target"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + prop = RNA_def_property(srna, "gravity_object", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text( |