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:
authorSergey Sharybin <sergey@blender.org>2020-11-24 14:40:42 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-24 14:40:42 +0300
commit82cc21d5e4b62aa191726c4d9d89d5f53a2197f7 (patch)
tree774ea44408c829cad9dbb544241a6096018284ca /source/blender/blenkernel/intern/multires_inline.h
parente74f61b49a8300d6a771801bf96aa34cca0cbf5a (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_inline.h')
-rw-r--r--source/blender/blenkernel/intern/multires_inline.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/multires_inline.h b/source/blender/blenkernel/intern/multires_inline.h
index 49329698b3a..e85aa12781e 100644
--- a/source/blender/blenkernel/intern/multires_inline.h
+++ b/source/blender/blenkernel/intern/multires_inline.h
@@ -25,6 +25,7 @@
#include "BKE_multires.h"
#include "BLI_math_vector.h"
+#include "BLI_utildefines.h"
BLI_INLINE void BKE_multires_construct_tangent_matrix(float tangent_matrix[3][3],
const float dPdu[3],
@@ -51,6 +52,9 @@ BLI_INLINE void BKE_multires_construct_tangent_matrix(float tangent_matrix[3][3]
copy_v3_v3(tangent_matrix[1], dPdv);
mul_v3_fl(tangent_matrix[0], -1.0f);
}
+ else {
+ BLI_assert(!"Unhandled corner index");
+ }
cross_v3_v3v3(tangent_matrix[2], dPdu, dPdv);
normalize_v3(tangent_matrix[0]);
normalize_v3(tangent_matrix[1]);