Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / armature / pose_lib.c
index fd5db84..02a1e22 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"
@@ -500,6 +501,7 @@ static int poselib_add_exec(bContext *C, wmOperator *op)
 
        /* store new 'active' pose number */
        act->active_marker = BLI_listbase_count(&act->markers);
+       DEG_id_tag_update(&act->id, DEG_TAG_COPY_ON_WRITE);
 
        /* done */
        return OPERATOR_FINISHED;
@@ -614,6 +616,7 @@ static int poselib_remove_exec(bContext *C, wmOperator *op)
         * may be being shown in anim editors as active action
         */
        WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
+       DEG_id_tag_update(&act->id, DEG_TAG_COPY_ON_WRITE);
 
        /* done */
        return OPERATOR_FINISHED;
@@ -1101,9 +1104,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(CTX_data_depsgraph(C), pld->scene, pld->ob);
        }
 
        /* do header print - if interactively previewing */
@@ -1609,9 +1612,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(CTX_data_depsgraph(C), scene, ob);
        }
        else if (pld->state == PL_PREVIEW_CONFIRM) {
                /* tag poses as appropriate */
@@ -1622,14 +1625,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(CTX_data_depsgraph(C), scene, ob);
        }
 
        /* Request final redraw of the view. */