From e90ba74d3eb826abab4ec65b82fe0176ce3b7d1b Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Fri, 3 Jun 2022 19:21:04 -0700 Subject: 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 --- source/blender/makesrna/intern/rna_sculpt_paint.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/blender/makesrna') 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( -- cgit v1.2.3