Merge branch 'master' into blender2.8
[blender.git] / source / blender / python / intern / bpy_rna_anim.c
index 693ff9549933f86f6911fbe1c1e215a89f1458c3..192738535b43effdc668932f86e0d8d33ef3b93a 100644 (file)
@@ -231,6 +231,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
                 * strips themselves. These are stored separately or else the properties will
                 * not have any effect.
                 */
+               struct Depsgraph *depsgraph = CTX_data_depsgraph(BPy_GetContext());
                ReportList reports;
                short result = 0;
 
@@ -252,7 +253,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
                        NlaStrip *strip = (NlaStrip *)ptr.data;
                        FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
 
-                       result = insert_keyframe_direct(&reports, ptr, prop, fcu, cfra, keytype, options);
+                       result = insert_keyframe_direct(depsgraph, &reports, ptr, prop, fcu, cfra, keytype, options);
                }
                else {
                        BKE_reportf(&reports, RPT_ERROR, "Could not resolve path (%s)", path_full);
@@ -265,12 +266,13 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
                return PyBool_FromLong(result);
        }
        else {
+               struct Depsgraph *depsgraph = CTX_data_depsgraph(BPy_GetContext());
                ReportList reports;
                short result;
 
                BKE_reports_init(&reports, RPT_STORE);
 
-               result = insert_keyframe(&reports, (ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, keytype, options);
+               result = insert_keyframe(depsgraph, &reports, (ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, keytype, options);
                MEM_freeN((void *)path_full);
 
                if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1)