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:
authorBastien Montagne <bastien@blender.org>2020-07-28 15:42:17 +0300
committerBastien Montagne <bastien@blender.org>2020-07-28 15:44:17 +0300
commitb99358315e5a16ec0b0ebbd5c37f9a38aaae04b9 (patch)
tree92da888ab6c017a9615486332cba4583b29eff51
parent76d489fe233ecc2e3309597b3054ff6e408a3e9a (diff)
Fix T79180: Object disappears when scaled, set origin etc after applying smooth modifier.
Very dummy mistake in modifier code would generate invalid number (divisions by zero)... Should also be ported to 2.83.
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index b03b949c946..deece2b999b 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -147,7 +147,7 @@ static void smoothModifier_do(
MDeformVert *dv = dvert;
for (int i = 0; i < numVerts; i++, dv++) {
float *vco_orig = vertexCos[i];
- if (num_accumulated_vecs[0] > 0) {
+ if (num_accumulated_vecs[i] > 0) {
mul_v3_fl(accumulated_vecs[i], 1.0f / (float)num_accumulated_vecs[i]);
}
float *vco_new = accumulated_vecs[i];
@@ -174,7 +174,7 @@ static void smoothModifier_do(
else { /* no vertex group */
for (int i = 0; i < numVerts; i++) {
float *vco_orig = vertexCos[i];
- if (num_accumulated_vecs[0] > 0) {
+ if (num_accumulated_vecs[i] > 0) {
mul_v3_fl(accumulated_vecs[i], 1.0f / (float)num_accumulated_vecs[i]);
}
float *vco_new = accumulated_vecs[i];