Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 0829fe06c2f..a838a9c26cb 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -826,22 +826,33 @@ static void BRUSH_OT_stencil_fit_image_aspect(wmOperatorType *ot)
}
-static int stencil_reset_transform(bContext *C, wmOperator *UNUSED(op))
+static int stencil_reset_transform(bContext *C, wmOperator *op)
{
Paint *paint = BKE_paint_get_active_from_context(C);
Brush *br = BKE_paint_brush(paint);
+ bool do_mask = RNA_boolean_get(op->ptr, "mask");
if (!br)
return OPERATOR_CANCELLED;
+
+ if (do_mask) {
+ br->mask_stencil_pos[0] = 256;
+ br->mask_stencil_pos[1] = 256;
- br->stencil_pos[0] = 256;
- br->stencil_pos[1] = 256;
+ br->mask_stencil_dimension[0] = 256;
+ br->mask_stencil_dimension[1] = 256;
+
+ br->mask_mtex.rot = 0;
+ }
+ else {
+ br->stencil_pos[0] = 256;
+ br->stencil_pos[1] = 256;
- br->stencil_dimension[0] = 256;
- br->stencil_dimension[1] = 256;
+ br->stencil_dimension[0] = 256;
+ br->stencil_dimension[1] = 256;
- br->mtex.rot = 0;
- br->mask_mtex.rot = 0;
+ br->mtex.rot = 0;
+ }
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -862,6 +873,8 @@ static void BRUSH_OT_stencil_reset_transform(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "mask", 0, "Modify Mask Stencil", "Modify either the primary or mask stencil");
}