diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-28 15:42:17 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-07-29 10:24:19 +0300 |
commit | 1e53ca9b719e93363f60be3cb58eed6874926f12 (patch) | |
tree | e77e70ae0fae557b4b54d4caf3554dfd059cb6c5 /source/blender | |
parent | 6ec565d1f5203700d7838ea69091a6b65f26a83d (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.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/modifiers/intern/MOD_smooth.c | 4 |
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 2a0376fd291..ff3dafa7e8b 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -135,7 +135,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]; @@ -162,7 +162,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]; |