diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-08-11 17:33:35 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-08-13 00:06:42 +0300 |
commit | c77bf952210a4947f151b3f6cb657584d788a548 (patch) | |
tree | a096173874507e35e7ee7f8397925b6b0ff70bed /source/blender/makesrna | |
parent | db7cfd03b08cbe5a2c986cfebfa4a04d8aa8a40d (diff) |
Sculpt: Boundary Brush Falloff Types and Offset
This adds the boundary_falloff_type and boundary_offset to control how the
falloff of the Boundary Brush is applied.
Boundary Origin Offset is the same concept as the Pose Origin offset in
the Pose Brush. It is a multiplier that adds extra length to the brush
radius to locate the deformation pivot further from the boundary without
affecting the falloff.
The Falloff type includes Constant (previous default), brush radius, loop
and loop and invert. Loop and Loop and Invert can be used to create
deformation patterns in a mesh.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8526
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 38916e2a45a..a3fa4fed575 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1997,6 +1997,31 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem brush_boundary_falloff_type_items[] = { + {BRUSH_BOUNDARY_FALLOFF_CONSTANT, + "CONSTANT", + 0, + "Constant", + "Applies the same deformation in the entire boundary"}, + {BRUSH_BOUNDARY_FALLOFF_RADIUS, + "RADIUS", + 0, + "Brush Radius", + "Applies the deformation in a localiced area limited by the brush radius"}, + {BRUSH_BOUNDARY_FALLOFF_LOOP, + "LOOP", + 0, + "Loop", + "Applies the brush falloff in a loop pattern"}, + {BRUSH_BOUNDARY_FALLOFF_LOOP_INVERT, + "LOOP_INVERT", + 0, + "Loop and Invert", + "Applies the fallof radius in a loop pattern, inverting the displacement direction in each " + "pattern repetition"}, + {0, NULL, 0, NULL, NULL}, + }; + static const EnumPropertyItem brush_cloth_simulation_area_type_items[] = { {BRUSH_CLOTH_SIMULATION_AREA_LOCAL, "LOCAL", @@ -2194,6 +2219,12 @@ static void rna_def_brush(BlenderRNA *brna) "Part of the mesh that is going to be simulated when the stroke is active"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "boundary_falloff_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, brush_boundary_falloff_type_items); + RNA_def_property_ui_text( + prop, "Boundary Falloff", "How the brush falloff is applied across the boundary"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "smooth_deform_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_smooth_deform_type_items); RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); @@ -2545,6 +2576,14 @@ static void rna_def_brush(BlenderRNA *brna) "Maximum distance to search for disconnected loose parts in the mesh"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "boundary_offset", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "boundary_offset"); + RNA_def_property_range(prop, 0.0f, 30.0f); + RNA_def_property_ui_text(prop, + "Boundary Origin Offset", + "Offset of the boundary origin in relation to the brush radius"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "surface_smooth_shape_preservation", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "surface_smooth_shape_preservation"); RNA_def_property_range(prop, 0.0f, 1.0f); |