From 950857656d6434605f8294c9deb857c93085eb17 Mon Sep 17 00:00:00 2001 From: ishbosamiya Date: Thu, 19 Aug 2021 18:53:36 +0530 Subject: 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. --- source/blender/blenkernel/intern/cloth_remesh.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/blender') 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); -- cgit v1.2.3