Fix T60836: Stretch to flickers when vertex group is used

Missing relation to object transform. Needed to convert vertex
position from local target object space to a local space of the
bone.
This commit is contained in:
Sergey Sharybin 2019-01-31 17:57:01 +01:00
parent 9d10fc13e7
commit 208a0808b3
Notes: blender-bot 2023-02-14 08:29:54 +01:00
Referenced by issue #60836, Cloth modifier acts erratically
2 changed files with 13 additions and 6 deletions

View File

@ -1062,10 +1062,17 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
(ct->subtarget[0]))
{
/* Vertex group. */
/* NOTE: for now, we don't need to represent vertex groups
* separately. */
ComponentKey target_key(&ct->tar->id, NodeType::GEOMETRY);
add_relation(target_key, constraint_op_key, cti->name);
/* NOTE: Vertex group is likely to be used to get vertices
* in a world space. This requires to know both geometry
* and transformation of the target object. */
ComponentKey target_transform_key(
&ct->tar->id, NodeType::TRANSFORM);
ComponentKey target_geometry_key(
&ct->tar->id, NodeType::GEOMETRY);
add_relation(
target_transform_key, constraint_op_key, cti->name);
add_relation(
target_geometry_key, constraint_op_key, cti->name);
add_customdata_mask(ct->tar, CD_MASK_MDEFORMVERT);
}
else if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) {

View File

@ -102,12 +102,12 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *object,
/* IK target */
/* TODO(sergey): This should get handled as part of the constraint code. */
if (data->tar != NULL) {
/* TODO(sergey): For until we'll store partial matricies in the
/* TODO(sergey): For until we'll store partial matrices in the
* depsgraph, we create dependency between target object and pose eval
* component.
*
* This way we ensuring the whole subtree is updated from scratch
* without need of intermediate matricies. This is an overkill, but good
* without need of intermediate matrices. This is an overkill, but good
* enough for testing IK solver. */
ComponentKey pose_key(&object->id, NodeType::EVAL_POSE);
if ((data->tar->type == OB_ARMATURE) && (data->subtarget[0])) {