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:
authorClément Foucault <foucault.clem@gmail.com>2020-05-28 14:43:57 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-05-28 14:43:57 +0300
commita9073ccb6895f188e43cfc6ddb507b5c1f69fc66 (patch)
tree596ea8624459bc7669adc2430386f8c8628323dd /source/blender/blenkernel/intern/dynamicpaint.c
parent59b730b64320a6746c73ac1a855188c9f1d5a2ad (diff)
parentff1040c6fefc4c54fef243635a915edf3f40355a (diff)
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index f3cc17f46f6..dae8a59fe43 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -2704,15 +2704,16 @@ static void dynamic_paint_find_island_border(const DynamicPaintCreateUVSurfaceDa
}
}
+ const int final_tri_index = tempPoints[final_index].tri_index;
/* If found pixel still lies on wrong face ( mesh has smaller than pixel sized faces) */
- if (tempPoints[final_index].tri_index != target_tri) {
+ if (final_tri_index != target_tri && final_tri_index != -1) {
/* Check if it's close enough to likely touch the intended triangle. Any triangle
* becomes thinner than a pixel at its vertices, so robustness requires some margin. */
const float final_pt[2] = {((final_index % w) + 0.5f) / w, ((final_index / w) + 0.5f) / h};
const float threshold = square_f(0.7f) / (w * h);
- if (dist_squared_to_looptri_uv_edges(
- mlooptri, mloopuv, tempPoints[final_index].tri_index, final_pt) > threshold) {
+ if (dist_squared_to_looptri_uv_edges(mlooptri, mloopuv, final_tri_index, final_pt) >
+ threshold) {
continue;
}
}