Fix T81842: Cloth brush not creating simulation areas for each tiling symmetry pass

The cloth brush fixed simulation areas are created using the initial_location variable in the
 StrokeCache. This variable was not being updated by tiling symmetry, so all symmetry passes
were using the same simulation area location.

Reviewed By: sergey

Maniphest Tasks: T81842

Differential Revision: https://developer.blender.org/D9421
This commit is contained in:
Pablo Dobarro 2020-11-02 22:54:19 +01:00
parent a5aa56cd71
commit e836c806e4
Notes: blender-bot 2023-02-13 20:48:46 +01:00
Referenced by issue #81842, Tiling doesn't work with cloth brushes with simulation area set to local
1 changed files with 3 additions and 0 deletions

View File

@ -6242,7 +6242,9 @@ static void do_tiled(
/* Position of the "prototype" stroke for tiling. */
float orgLoc[3];
float original_initial_location[3];
copy_v3_v3(orgLoc, cache->location);
copy_v3_v3(original_initial_location, cache->initial_location);
for (int dim = 0; dim < 3; dim++) {
if ((sd->paint.symmetry_flags & (PAINT_TILE_X << dim)) && step[dim] > 0) {
@ -6273,6 +6275,7 @@ static void do_tiled(
for (int dim = 0; dim < 3; dim++) {
cache->location[dim] = cur[dim] * step[dim] + orgLoc[dim];
cache->plane_offset[dim] = cur[dim] * step[dim];
cache->initial_location[dim] = cur[dim] * step[dim] + original_initial_location[dim];
}
action(sd, ob, brush, ups);
}