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:
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
parent12db4f3eae0981607d5fe35007ef134687b19b95 (diff)
Fix #35190: texture mask stencil Reset Transform did not work properly.
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py2
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c27
2 files changed, 21 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 1b6356f0dba..65ab1246c19 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -131,7 +131,7 @@ def brush_mask_texture_settings(layout, brush):
if mask_tex_slot.map_mode == 'STENCIL':
if brush.mask_texture and brush.mask_texture.type == 'IMAGE':
layout.operator("brush.stencil_fit_image_aspect").mask = True
- layout.operator("brush.stencil_reset_transform")
+ layout.operator("brush.stencil_reset_transform").mask = True
if brush.mask_texture:
layout.label(text="Mask Mapping:")
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");
}