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:
authorCampbell Barton <campbell@blender.org>2022-04-27 04:24:25 +0300
committerCampbell Barton <campbell@blender.org>2022-09-15 09:17:17 +0300
commit0e172e9732a1cab2aba324ce10ce304df7b69338 (patch)
tree19e23b7a4798553a18d8dcab1f13596ea6100915 /source/blender/makesdna
parent2c53970bbfa44f58d436e9ca286875fa3919e364 (diff)
Fix T95649: Corrective Smooth can cause vertices to jump
Calculate a tangent per loop, apply the transformation in multiple spaces and accumulate the result weighting by the loop-angle. Note that previously only the tangents Z axis (normal) was properly accumulated, the X and Y axes only contained the values from a single loop (the last one written to), meaning only two edges contributed to the result. Now the transformation from all loops are taken into account. In practice the difference between both methods is minimal, only for more extreme bending it can be noticed which is often when the previous method didn't work as well.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 787f52f9891..7625f04fefa 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1856,9 +1856,13 @@ enum {
};
typedef struct CorrectiveSmoothDeltaCache {
- /* delta's between the original positions and the smoothed positions */
+ /**
+ * Delta's between the original positions and the smoothed positions,
+ * calculated loop-tangent and which is accumulated into the vertex it uses.
+ * (run-time only).
+ */
float (*deltas)[3];
- unsigned int totverts;
+ unsigned int deltas_num;
/* Value of settings when creating the cache.
* These are used to check if the cache should be recomputed. */