Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-04-13 17:36:57 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-04-13 17:36:57 +0300
commit3d8790faf17b665eecf10868939ce9fb9c794ddd (patch)
treeeed541bf61e25a2d4e5e49a98f06920a84468b56 /source
parent51c8a6f491d3b21a6c91af6267f58d4f0add58af (diff)
Fix T62048: crash when turning off curve path animation with Spline IK.
Both fix missing depsgraph flag, and gracefully give up on missing data.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/armature_update.c24
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc1
2 files changed, 6 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index 5cd82803fae..1e9febd4d8e 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -71,7 +71,7 @@ typedef struct tSplineIK_Tree {
/* ----------- */
/* Tag the bones in the chain formed by the given bone for IK */
-static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPoseChannel *pchan_tip)
+static void splineik_init_tree_from_pchan(Scene *UNUSED(scene), Object *UNUSED(ob), bPoseChannel *pchan_tip)
{
bPoseChannel *pchan, *pchanRoot = NULL;
bPoseChannel *pchanChain[255];
@@ -102,28 +102,14 @@ static void splineik_init_tree_from_pchan(Scene *scene, Object *UNUSED(ob), bPos
return;
/* make sure that the constraint targets are ok
- * - this is a workaround for a depsgraph bug...
+ * - this is a workaround for a depsgraph bug or dependency cycle...
*/
if (ikData->tar) {
- /* note: when creating constraints that follow path, the curve gets the CU_PATH set now,
- * currently for paths to work it needs to go through the bevlist/displist system (ton)
- */
+ CurveCache *cache = ikData->tar->runtime.curve_cache;
- /* TODO: Make sure this doesn't crash. */
-#if 0
- /* only happens on reload file, but violates depsgraph still... fix! */
- if (ELEM(NULL, ikData->tar->curve_cache, ikData->tar->curve_cache->path, ikData->tar->curve_cache->path->data)) {
- BKE_displist_make_curveTypes(depsgraph, scene, ikData->tar, 0);
-
- /* path building may fail in EditMode after removing verts [#33268]*/
- if (ELEM(NULL, ikData->tar->curve_cache->path, ikData->tar->curve_cache->path->data)) {
- /* BLI_assert(cu->path != NULL); */
- return;
- }
+ if (ELEM(NULL, cache, cache->path, cache->path->data)) {
+ return;
}
-#else
- (void) scene;
-#endif
}
/* find the root bone and the chain of bones from the root to the tip
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 35652ebb53e..c9f86652262 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
@@ -262,6 +262,7 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *object,
if (data->tar != NULL) {
ComponentKey target_key(&data->tar->id, NodeType::GEOMETRY);
add_relation(target_key, init_ik_key, "Curve.Path -> Spline IK");
+ add_special_eval_flag(&data->tar->id, DAG_EVAL_NEED_CURVE_PATH);
}
pchan->flag |= POSE_DONE;
OperationKey final_transforms_key(