[Bf-blender-cvs] [e551ddf712e] master: Fix T60393: Subdiv gives wrong vertex colors
Sergey Sharybin
noreply at git.blender.org
Thu Jan 10 17:09:50 CET 2019
Commit: e551ddf712e5e8c8fb4bfcd99158158ac2f7d56e
Author: Sergey Sharybin
Date: Thu Jan 10 17:01:35 2019 +0100
Branches: master
https://developer.blender.org/rBe551ddf712e5e8c8fb4bfcd99158158ac2f7d56e
Fix T60393: Subdiv gives wrong vertex colors
===================================================================
M source/blender/blenkernel/intern/subdiv_mesh.c
===================================================================
diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c
index 4d1b436ca16..9c4793a9efc 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
@@ -385,13 +385,14 @@ static void loop_interpolation_from_corner(
* middle points.
*
* TODO(sergey): Re-use one of interpolation results from previous
- * iteration.
- */
+ * iteration. */
const float weights[2] = {0.5f, 0.5f};
- const int first_indices[2] = {
- loops_of_ptex.first_loop - coarse_mloop,
- (loops_of_ptex.first_loop + 1 - coarse_mloop) %
- coarse_poly->totloop};
+ const int base_loop_index = coarse_poly->loopstart;
+ const int first_loop_index = loops_of_ptex.first_loop - coarse_mloop;
+ const int second_loop_index =
+ base_loop_index +
+ (first_loop_index - base_loop_index + 1) % coarse_poly->totloop;
+ const int first_indices[2] = {first_loop_index, second_loop_index};
const int last_indices[2] = {
loops_of_ptex.last_loop - coarse_mloop,
loops_of_ptex.first_loop - coarse_mloop};
More information about the Bf-blender-cvs
mailing list