Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / armature / pose_lib.c
index ac38500c84170b6eba8f71bbf58c536fab8c8b45..0dbe3ddaa0a5586f9ab1cd9bd548ea1ae88f8eda 100644 (file)
@@ -46,7 +46,6 @@
 #include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_armature.h"
-#include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_idprop.h"
 #include "BKE_library.h"
@@ -55,6 +54,8 @@
 #include "BKE_context.h"
 #include "BKE_report.h"
 
+#include "DEG_depsgraph.h"
+
 #include "RNA_access.h"
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
@@ -1067,6 +1068,9 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, tPoseLib_PreviewData
 static void poselib_preview_apply(bContext *C, wmOperator *op)
 {
        tPoseLib_PreviewData *pld = (tPoseLib_PreviewData *)op->customdata;
+       EvaluationContext eval_ctx;
+
+       CTX_data_eval_ctx(C, &eval_ctx);
        
        /* only recalc pose (and its dependencies) if pose has changed */
        if (pld->redraw == PL_PREVIEW_REDRAWALL) {
@@ -1089,9 +1093,9 @@ static void poselib_preview_apply(bContext *C, wmOperator *op)
                 */
                // FIXME: shouldn't this use the builtin stuff?
                if ((pld->arm->flag & ARM_DELAYDEFORM) == 0)
-                       DAG_id_tag_update(&pld->ob->id, OB_RECALC_DATA);  /* sets recalc flags */
+                       DEG_id_tag_update(&pld->ob->id, OB_RECALC_DATA);  /* sets recalc flags */
                else
-                       BKE_pose_where_is(pld->scene, pld->ob);
+                       BKE_pose_where_is(&eval_ctx, pld->scene, pld->ob);
        }
        
        /* do header print - if interactively previewing */
@@ -1582,6 +1586,9 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
        bArmature *arm = pld->arm;
        bAction *act = pld->act;
        TimeMarker *marker = pld->marker;
+       EvaluationContext eval_ctx;
+
+       CTX_data_eval_ctx(C, &eval_ctx);
        
        /* redraw the header so that it doesn't show any of our stuff anymore */
        ED_area_headerprint(pld->sa, NULL);
@@ -1597,9 +1604,9 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
                 *      - note: code copied from transform_generics.c -> recalcData()
                 */
                if ((arm->flag & ARM_DELAYDEFORM) == 0)
-                       DAG_id_tag_update(&ob->id, OB_RECALC_DATA);  /* sets recalc flags */
+                       DEG_id_tag_update(&ob->id, OB_RECALC_DATA);  /* sets recalc flags */
                else
-                       BKE_pose_where_is(scene, ob);
+                       BKE_pose_where_is(&eval_ctx, scene, ob);
        }
        else if (pld->state == PL_PREVIEW_CONFIRM) {
                /* tag poses as appropriate */
@@ -1610,14 +1617,14 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
                action_set_activemarker(act, marker, NULL);
                
                /* Update event for pose and deformation children */
-               DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+               DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
                
                /* updates */
                if (IS_AUTOKEY_MODE(scene, NORMAL)) {
                        //remake_action_ipos(ob->action);
                }
                else
-                       BKE_pose_where_is(scene, ob);
+                       BKE_pose_where_is(&eval_ctx, scene, ob);
        }
        
        /* Request final redraw of the view. */