diff options
author | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-19 16:23:36 +0300 |
---|---|---|
committer | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-19 16:23:36 +0300 |
commit | 950857656d6434605f8294c9deb857c93085eb17 (patch) | |
tree | f46800dde5fa9e3ba23ec01e1905aeac7b915088 /source/blender/blenkernel/intern | |
parent | bf0f1184192f8f18dc259a732d3186660558a8b0 (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/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/cloth_remesh.cc | 6 |
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); |