[Bf-blender-cvs] [950857656d6] soc-2021-adaptive-cloth: adaptive_cloth: ClothNodeData: interp goal correctly
ishbosamiya
noreply at git.blender.org
Sun Aug 22 17:23:41 CEST 2021
Commit: 950857656d6434605f8294c9deb857c93085eb17
Author: ishbosamiya
Date: Thu Aug 19 18:53:36 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rB950857656d6434605f8294c9deb857c93085eb17
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.
===================================================================
M source/blender/blenkernel/intern/cloth_remesh.cc
===================================================================
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);
More information about the Bf-blender-cvs
mailing list