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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-02 21:55:17 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-02 21:55:17 +0400
commitcc86176a608ac97d064e53d52e2abad8479f2d56 (patch)
tree028bd0c6c034ecb8f38f2c6ef3b706c1772b9d6e /source
parent12db4f3eae0981607d5fe35007ef134687b19b95 (diff)
Fix #35190: texture mask stencil Reset Transform did not work properly.
Diffstat (limited to 'source')
-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");
}