From 208a0808b31e374d8116f46e5c8a4be8ced6b289 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 31 Jan 2019 17:57:01 +0100 Subject: 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. --- .../depsgraph/intern/builder/deg_builder_relations.cc | 15 +++++++++++---- .../depsgraph/intern/builder/deg_builder_relations_rig.cc | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index a27507954fb..633646da918 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -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) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 0915da3f7cc..3ef0a13db66 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -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])) { -- cgit v1.2.3