diff options
author | Jose C. Rubio <> | 2019-03-13 17:13:52 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-03-13 17:16:28 +0300 |
commit | 76437b903de37ee96a5306429fe8e17ccbaa1de7 (patch) | |
tree | e8abd6e4d9030e55e49237d3e7788c63edb85d00 /source | |
parent | eb1580961a850a0723d8f306ca9c843686273b86 (diff) |
Fix T60185: Crash on adding Inverse Kinematics
When having loops in a kinematic chain and also a IK constrain,
the solve_cycle function removes graph relations necessary to ensure
the cleanup operation was running at the very end.
Due to his Blender was crashing when some operations (the bone
constraints) accessed a pointer that was already freed.
Solved by adding more relations between crucial nodes.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc | 11 |
1 files changed, 9 insertions, 2 deletions
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 fe88b532dca..e3a2f8d786a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -456,7 +456,8 @@ void DepsgraphRelationBuilder::build_rig(Object *object) NodeType::BONE, pchan->name, OperationCode::BONE_CONSTRAINTS); - add_relation(bone_pose_key, constraints_key, "Constraints Stack"); + add_relation(bone_pose_key, constraints_key, "Pose -> Constraints Stack"); + add_relation(bone_local_key, constraints_key, "Local -> Constraints Stack"); /* Constraints -> ready/ */ /* TODO(sergey): When constraint stack is exploded, this step should * occur before the first IK solver. */ @@ -518,9 +519,15 @@ void DepsgraphRelationBuilder::build_rig(Object *object) add_relation(bone_done_key, pose_done_key, "PoseEval Result-Bone Link"); + + /* Bones must be traversed before cleanup. */ add_relation(bone_done_key, pose_cleanup_key, - "Cleanup dependency"); + "Done -> Cleanup"); + + add_relation(bone_ready_key, + pose_cleanup_key, + "Ready -> Cleanup"); } /* Custom shape. */ if (pchan->custom != NULL) { |