diff options
author | Sergey Sharybin <sergey@blender.org> | 2020-11-24 14:40:42 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2020-11-24 14:40:42 +0300 |
commit | 82cc21d5e4b62aa191726c4d9d89d5f53a2197f7 (patch) | |
tree | 774ea44408c829cad9dbb544241a6096018284ca /source/blender/blenkernel/intern/multires_reshape_smooth.c | |
parent | e74f61b49a8300d6a771801bf96aa34cca0cbf5a (diff) |
Fix T77261: Multires creates spikes when subdividing ngons
The spikes were caused by non-initialized tangent matrix used during
smoothing process. The reason tangent matrix was not initialized was
because wrong usage of API: n-gons should pass corner of 0 to the
matrix construction function.
Corrected usage of the API and added assert() to help catching such
kind of non-initialized issues easier.
Diffstat (limited to 'source/blender/blenkernel/intern/multires_reshape_smooth.c')
-rw-r--r-- | source/blender/blenkernel/intern/multires_reshape_smooth.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/multires_reshape_smooth.c b/source/blender/blenkernel/intern/multires_reshape_smooth.c index e12e692ea23..f10aae18142 100644 --- a/source/blender/blenkernel/intern/multires_reshape_smooth.c +++ b/source/blender/blenkernel/intern/multires_reshape_smooth.c @@ -1154,8 +1154,11 @@ static void reshape_subdiv_evaluate_limit_at_grid( dPdu, dPdv); + const int face_index = multires_reshape_grid_to_face_index(reshape_context, + grid_coord->grid_index); const int corner = multires_reshape_grid_to_corner(reshape_context, grid_coord->grid_index); - BKE_multires_construct_tangent_matrix(r_tangent_matrix, dPdu, dPdv, corner); + multires_reshape_tangent_matrix_for_corner( + reshape_context, face_index, corner, dPdu, dPdv, r_tangent_matrix); } /** \} */ |