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:
authorAntony Riakiotakis <kalast@gmail.com>2013-04-22 14:46:01 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-04-22 14:46:01 +0400
commitc0eadedb7061ac9f69b3f8ecf5fd675d6a22221c (patch)
tree90000d4bf57d3e687cbe7548a374d17dfeb78fce /source/blender/editors/sculpt_paint/paint_stroke.c
parent53479be58105155c319b7862c0e2c2d45415846d (diff)
Support more mapping modes for alpha masks. Tiled, stencil and random
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index bbddd2e4a69..d754567bd99 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -160,6 +160,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
if (paint_supports_dynamic_size(brush, mode) || !stroke->brush_init) {
copy_v2_v2(stroke->initial_mouse, mouse);
copy_v2_v2(ups->tex_mouse, mouse);
+ copy_v2_v2(ups->mask_tex_mouse, mouse);
stroke->cached_pressure = pressure;
}
@@ -186,11 +187,22 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
}
if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)
- BKE_brush_randomize_texture_coordinates(ups);
- else
+ BKE_brush_randomize_texture_coordinates(ups, false);
+ else {
copy_v2_v2(ups->tex_mouse, mouse);
+ }
+ }
+
+ /* take care of mask texture, if any */
+ if (brush->mask_mtex.tex) {
+ if (brush->mask_mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)
+ BKE_brush_randomize_texture_coordinates(ups, true);
+ else {
+ copy_v2_v2(ups->mask_tex_mouse, mouse);
+ }
}
+
if (brush->flag & BRUSH_ANCHORED) {
bool hit = false;
float halfway[2];