Fix T47734: Rest Position is not working with new Deps
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 15 Mar 2016 11:13:00 +0000 (16:13 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 15 Mar 2016 11:13:25 +0000 (16:13 +0500)
source/blender/depsgraph/intern/depsgraph_build_nodes.cc
source/blender/depsgraph/intern/depsgraph_build_relations.cc

index 7457b43fd38b6f4bb379976cd3b9bee8464ecc8b..0a5235a6d11471c7dda92a6e5ab9594ba1fa6ab9 100644 (file)
@@ -778,6 +778,14 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob)
                }
        }
 
+       /* Make sure pose is up-to-date with armature updates. */
+       add_operation_node(&arm->id,
+                          DEPSNODE_TYPE_PARAMETERS,
+                          DEPSOP_TYPE_EXEC,
+                          NULL,
+                          DEG_OPCODE_PLACEHOLDER,
+                          "Armature Eval");
+
        /**
         * Pose Rig Graph
         * ==============
index efeeff274300894133e9c36963a71dc5842d3da1..226991e7b11e6e42043430a309ff8c6c4733128c 100644 (file)
@@ -1366,6 +1366,8 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob,
 void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 {
        /* Armature-Data */
+       bArmature *arm = (bArmature *)ob->data;
+
        // TODO: selection status?
 
        /* attach links between pose operations */
@@ -1374,6 +1376,13 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
 
        add_relation(init_key, flush_key, DEPSREL_TYPE_COMPONENT_ORDER, "[Pose Init -> Pose Cleanup]");
 
+       /* Make sure pose is up-to-date with armature updates. */
+       OperationKey armature_key(&arm->id,
+                                 DEPSNODE_TYPE_PARAMETERS,
+                                 DEG_OPCODE_PLACEHOLDER,
+                                 "Armature Eval");
+       add_relation(armature_key, init_key, DEPSREL_TYPE_COMPONENT_ORDER, "Data dependency");
+
        if (ob->adt && (ob->adt->action || ob->adt->nla_tracks.first)) {
                ComponentKey animation_key(&ob->id, DEPSNODE_TYPE_ANIMATION);
                add_relation(animation_key, init_key, DEPSREL_TYPE_OPERATION, "Rig Animation");