Fix #127279: Various brushes do not work on multires

Introduced with 347ec1acd7.

Various brushes use the `calc_area_normal_and_center_node_grids`
function to determine their displacment. Prior to this commit, the
calculation of this plane normal was not iterating over the `IndexMask`
correctly.

This manifested on the default cube at multires levels greater than 6,
because at that point the number of PBVH nodes was greater than 1,
leading to the wrong nodes being used to calculate this effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/127474
This commit is contained in:
Sean Kim
2024-09-12 01:46:12 +02:00
committed by Sean Kim
parent 4d88c18e8b
commit 8b3794514b

View File

@@ -2311,9 +2311,9 @@ void calc_area_normal_and_center(const Depsgraph &depsgraph,
AreaNormalCenterData{},
[&](const IndexRange range, AreaNormalCenterData anctd) {
SampleLocalData &tls = all_tls.local();
for (const int i : range) {
node_mask.slice(range).foreach_index([&](const int i) {
calc_area_normal_and_center_node_grids(ob, brush, true, true, nodes[i], tls, anctd);
}
});
return anctd;
},
calc_area_normal_and_center_reduce);