diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-03-26 01:48:10 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-26 02:02:06 +0300 |
commit | 366cb3a0592af4736fa9efc5881eab4760b7cba7 (patch) | |
tree | 5a17cdb7bf3e3492eab008dfb4aacce04423b1c9 /source/blender/editors/sculpt_paint | |
parent | 99e693d1267e2495a57b18f41dedd7b1a8f24fcf (diff) |
Fix T74711: tiling brush option in image editor not working anymore
This makes it work again at least for the non-UDIM case. For UDIM it's not
great still but I'll consider that a known limitation. A proper solution is
probably to find the closest tile at the start of the stroke and then only
paint in that one tile for the rest of the stroke.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_2d.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index fc56c5cb6c6..73c099c9407 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -1609,7 +1609,9 @@ void paint_2d_stroke(void *ps, copy_v2_v2(last_uv, old_uv); } - float uv_brush_size[2] = {base_size / s->tiles[0].size[0], base_size / s->tiles[0].size[1]}; + const float uv_brush_size[2] = { + (s->symmetry & PAINT_TILE_X) ? FLT_MAX : base_size / s->tiles[0].size[0], + (s->symmetry & PAINT_TILE_Y) ? FLT_MAX : base_size / s->tiles[0].size[1]}; for (int i = 0; i < s->num_tiles; i++) { ImagePaintTile *tile = &s->tiles[i]; @@ -1640,7 +1642,8 @@ void paint_2d_stroke(void *ps, paint_2d_uv_to_coord(tile, last_uv, tile->last_paintpos); /* Second check in pixel coordinates. */ - const float pixel_brush_size[] = {size, size}; + const float pixel_brush_size[] = {(s->symmetry & PAINT_TILE_X) ? FLT_MAX : size, + (s->symmetry & PAINT_TILE_Y) ? FLT_MAX : size}; if (!(is_inside_tile(tile->size, new_coord, pixel_brush_size) || is_inside_tile(tile->size, old_coord, pixel_brush_size))) { continue; |