diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-15 13:38:56 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-15 13:43:59 +0300 |
commit | 4d8b78b0a9b760bba2f715a7421b3fdd5e076ccf (patch) | |
tree | 899cc855ceb757d4013656fcb450a1529065ad48 /source/blender/makesrna/intern/rna_sculpt_paint.c | |
parent | 6cb06501c3283a4d443151ddb93ec5a097cd9078 (diff) |
Sculpting: Sdd an option to hide mask in viewport
Brushes themselves are still affected by the mask, but the viewport is not
showing the mask. This way it's easier to see details while sculpting.
Studio request by Julien Kaspar
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 9da27233e0e..6dbfc3634b2 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -287,6 +287,20 @@ static void rna_Sculpt_ShowDiffuseColor_update(Main *UNUSED(bmain), Scene *scene } } +static void rna_Sculpt_ShowMask_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +{ + Object *object = (scene->basact) ? scene->basact->object : NULL; + if (object == NULL || object->sculpt == NULL) { + return; + } + Sculpt *sd = scene->toolsettings->sculpt; + object->sculpt->show_mask = ((sd->flags & SCULPT_HIDE_MASK) == 0); + if (object->sculpt->pbvh != NULL) { + pbvh_show_mask_set(object->sculpt->pbvh, object->sculpt->show_mask); + } + WM_main_add_notifier(NC_OBJECT | ND_DRAW, object); +} + static char *rna_Sculpt_path(PointerRNA *UNUSED(ptr)) { return BLI_strdup("tool_settings.sculpt"); @@ -594,6 +608,11 @@ static void rna_def_sculpt(BlenderRNA *brna) "Show diffuse color of object and overlay sculpt mask on top of it"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowDiffuseColor_update"); + prop = RNA_def_property(srna, "show_mask", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flags", SCULPT_HIDE_MASK); + RNA_def_property_ui_text(prop, "Show Mask", "Show mask as overlay on object"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowMask_update"); + prop = RNA_def_property(srna, "detail_size", PROP_FLOAT, PROP_PIXEL); RNA_def_property_ui_range(prop, 0.5, 40.0, 10, 2); RNA_def_property_ui_text(prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)"); |