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:
authorishbosamiya <ishbosamiya@gmail.com>2021-08-19 16:23:36 +0300
committerishbosamiya <ishbosamiya@gmail.com>2021-08-19 16:23:36 +0300
commit950857656d6434605f8294c9deb857c93085eb17 (patch)
treef46800dde5fa9e3ba23ec01e1905aeac7b915088 /source/blender
parentbf0f1184192f8f18dc259a732d3186660558a8b0 (diff)
adaptive_cloth: ClothNodeData: interp goal correctly
The goal of the ClothVertex causes the vertex to move towards xconst so it doesn't make sense to interpolate the goal since this will lead to a gradient for the goal and this is not artist friendly, there would be no way for the artist to define only a specific vertex to be attached to a point in 3D space.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/cloth_remesh.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cloth_remesh.cc b/source/blender/blenkernel/intern/cloth_remesh.cc
index d1aeec382a8..ec4009f1e37 100644
--- a/source/blender/blenkernel/intern/cloth_remesh.cc
+++ b/source/blender/blenkernel/intern/cloth_remesh.cc
@@ -148,7 +148,11 @@ class ClothNodeData {
interp_v3_v3v3(cn.txold, this->cloth_node_data.txold, other.cloth_node_data.txold, 0.5);
interp_v3_v3v3(cn.tv, this->cloth_node_data.tv, other.cloth_node_data.tv, 0.5);
cn.mass = simple_interp(this->cloth_node_data.mass, other.cloth_node_data.mass);
- cn.goal = simple_interp(this->cloth_node_data.goal, other.cloth_node_data.goal);
+ /* No new nodes should have a goal since the artist has not added
+ * the node and iterpolating the weights for newly added nodes can
+ * lead to unexpected results that cannot be fixed by the
+ * artist */
+ cn.goal = 0.0;
interp_v3_v3v3(cn.impulse, this->cloth_node_data.impulse, other.cloth_node_data.impulse, 0.5);
interp_v3_v3v3(cn.xrest, this->cloth_node_data.xrest, other.cloth_node_data.xrest, 0.5);
interp_v3_v3v3(cn.dcvel, this->cloth_node_data.dcvel, other.cloth_node_data.dcvel, 0.5);