From b4b269f38e6dbf45f97d2b80e6a4d7f787d85192 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 11 May 2016 09:23:11 +0200 Subject: Depsgraph: Add some missing relations Those cases requires not only geometry component, but also a transform one to be ready before evaluation can start. --- source/blender/modifiers/intern/MOD_armature.c | 1 + source/blender/modifiers/intern/MOD_hook.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index d9ace45453c..2241a787630 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -124,6 +124,7 @@ static void updateDepsgraph(ModifierData *md, ArmatureModifierData *amd = (ArmatureModifierData *)md; if (amd->object != NULL) { DEG_add_object_relation(node, amd->object, DEG_OB_COMP_EVAL_POSE, "Armature Modifier"); + DEG_add_object_relation(node, amd->object, DEG_OB_COMP_TRANSFORM, "Armature Modifier"); } } diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index e175f4943a7..bec0cc0d8a3 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -139,20 +139,21 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, static void updateDepsgraph(ModifierData *md, struct Main *UNUSED(bmain), struct Scene *UNUSED(scene), - Object *UNUSED(ob), + Object *ob, struct DepsNodeHandle *node) { HookModifierData *hmd = (HookModifierData *)md; if (hmd->object != NULL) { if (hmd->subtarget[0]) { - /* TODO(sergey): Hpw do we add relation to bone here? */ - //DEG_add_object_relation(node, hmd->object, DEG_OB_COMP_EVAL_POSE, "Hook Modifier"); + DEG_add_bone_relation(node, hmd->object, hmd->subtarget, DEG_OB_COMP_TRANSFORM, "Hook Modifier"); DEG_add_bone_relation(node, hmd->object, hmd->subtarget, DEG_OB_COMP_BONE, "Hook Modifier"); } else { DEG_add_object_relation(node, hmd->object, DEG_OB_COMP_TRANSFORM, "Hook Modifier"); } } + /* We need own transformation as well. */ + DEG_add_object_relation(node, ob, DEG_OB_COMP_TRANSFORM, "Hook Modifier"); } struct HookData_cb { -- cgit v1.2.3