From db40b62252e5a7716cd403a0574cc164163b2ce9 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Mon, 17 Oct 2022 11:17:42 +0200 Subject: Sculpt: Auto-masking UI improvements Add auto-masking as a popover in the header while in Sculpt mode, following the design in T101593. These properties were present in the Options panel (and popover), they have been removed from there. Moreover, this commit makes the auto-masking section in Brush settings match the new popover. In the future this popover can be used for other modes that support auto-masking such as Grease Pencil. See D16145 for details and screenshots. Reviewed By: JulienKaspar Differential Revision: https://developer.blender.org/D16145 --- source/blender/makesrna/intern/rna_brush.c | 9 ++++++--- source/blender/makesrna/intern/rna_sculpt_paint.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 5e4b08d8a41..b44b0620329 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -3240,18 +3240,21 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Brush_update"); } while ((++entry)->identifier); - prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "automasking_cavity_factor"); + RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask"); - RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_range(prop, 0.0f, 5.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Brush_update"); prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "automasking_cavity_blur_steps"); + RNA_def_property_int_default(prop, 0); RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred"); - RNA_def_property_range(prop, 0.0f, 25.0f); + RNA_def_property_range(prop, 0, 25); + RNA_def_property_ui_range(prop, 0, 10, 1, 1); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Brush_update"); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index d8ad3d1f41e..440309849ab 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -927,17 +927,20 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); } while ((++entry)->identifier); - prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "automasking_cavity_factor"); RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask"); - RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); + RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0.0f, 5.0f); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "automasking_cavity_blur_steps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "automasking_cavity_blur_steps"); RNA_def_property_ui_text(prop, "Blur Steps", "The number of times the cavity mask is blurred"); - RNA_def_property_range(prop, 0.0f, 25.0f); + RNA_def_property_int_default(prop, 0); + RNA_def_property_range(prop, 0, 25); + RNA_def_property_ui_range(prop, 0, 10, 1, 1); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "automasking_cavity_curve", PROP_POINTER, PROP_NONE); -- cgit v1.2.3