[Bf-blender-cvs] [76437b903de] master: Fix T60185: Crash on adding Inverse Kinematics

Jose C. Rubio noreply at git.blender.org
Wed Mar 13 15:17:54 CET 2019


Commit: 76437b903de37ee96a5306429fe8e17ccbaa1de7
Author: Jose C. Rubio
Date:   Wed Mar 13 15:13:52 2019 +0100
Branches: master
https://developer.blender.org/rB76437b903de37ee96a5306429fe8e17ccbaa1de7

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.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc

===================================================================

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) {



More information about the Bf-blender-cvs mailing list