Fix #22340: sintel appears in seemingly random poses on load.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 7 Jul 2010 18:47:49 +0000 (18:47 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 7 Jul 2010 18:47:49 +0000 (18:47 +0000)
Pose proxy synchronization happened after drivers were already evaluated,
now moved to start of object_handle_update.

source/blender/blenkernel/intern/object.c

index 1b8405a91de73eebd18136076a5d3a19794c3b8f..78ec473ef9369f511310f050501b7fe74a838164 100644 (file)
@@ -2479,6 +2479,17 @@ void object_handle_update(Scene *scene, Object *ob)
                if(ob->pose)
                        make_pose_channels_hash(ob->pose);
 
+               if(ob->recalc & OB_RECALC_DATA) {
+                       if(ob->type==OB_ARMATURE) {
+                               /* this happens for reading old files and to match library armatures
+                                  with poses we do it ahead of where_is_object to ensure animation
+                                  is evaluated on the rebuilt pose, otherwise we get incorrect poses
+                                  on file load */
+                               if(ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
+                                       armature_rebuild_pose(ob, ob->data);
+                       }
+               }
+
                /* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers, 
                   which is only in where_is_object now */
                // XXX: should this case be OB_RECALC_OB instead?
@@ -2541,11 +2552,6 @@ void object_handle_update(Scene *scene, Object *ob)
                                lattice_calc_modifiers(scene, ob);
                        }
                        else if(ob->type==OB_ARMATURE) {
-                               /* this happens for reading old files and to match library armatures with poses */
-                               // XXX this won't screw up the pose set already...
-                               if(ob->pose==NULL || (ob->pose->flag & POSE_RECALC))
-                                       armature_rebuild_pose(ob, ob->data);
-                               
                                /* evaluate drivers */
                                BKE_animsys_evaluate_animdata(data_id, adt, ctime, ADT_RECALC_DRIVERS);