diff options
author | Jacques Lucke <jacques@blender.org> | 2022-07-14 11:35:46 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-07-14 11:35:59 +0300 |
commit | 44e530e1b107fd0d91f472f9a58642ab59fd5422 (patch) | |
tree | 61a70d743c7a61bf899ec49e67894ec26d0b2c23 /source/blender | |
parent | 9d73bbd9668aaa9fd407780309f5b63b05655fcd (diff) |
Geometry Nodes: fix face corner to edge attribute interpolation
Looks like this was wrong all the time.. Luckily, this conversion
is not very common.
Found when testing D15274.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_component_mesh.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc index cf6681a69be..83bf2a5d27b 100644 --- a/source/blender/blenkernel/intern/geometry_component_mesh.cc +++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc @@ -298,12 +298,14 @@ static void adapt_mesh_domain_corner_to_edge_impl(const Mesh &mesh, const MPoly &poly = mesh.mpoly[poly_index]; /* For every edge, mix values from the two adjacent corners (the current and next corner). */ - for (const int loop_index : IndexRange(poly.loopstart, poly.totloop)) { - const int loop_index_next = (loop_index + 1) % poly.totloop; - const MLoop &loop = mesh.mloop[loop_index]; + for (const int i : IndexRange(poly.totloop)) { + const int next_i = (i + 1) % poly.totloop; + const int loop_i = poly.loopstart + i; + const int next_loop_i = poly.loopstart + next_i; + const MLoop &loop = mesh.mloop[loop_i]; const int edge_index = loop.e; - mixer.mix_in(edge_index, old_values[loop_index]); - mixer.mix_in(edge_index, old_values[loop_index_next]); + mixer.mix_in(edge_index, old_values[loop_i]); + mixer.mix_in(edge_index, old_values[next_loop_i]); } } |