Commit: 1e53ca9b719e93363f60be3cb58eed6874926f12
Author: Bastien Montagne
Date:   Tue Jul 28 14:42:17 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB1e53ca9b719e93363f60be3cb58eed6874926f12

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.

===================================================================

M       source/blender/modifiers/intern/MOD_smooth.c

===================================================================

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];

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to