diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:06:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 10:06:14 +0300 |
commit | 5b643018348280ee601a20fb9329d5a313c23446 (patch) | |
tree | b2bb37028ac88a655aea37bb7a8b850b84885cea /source/blender/python/intern/bpy_rna_anim.c | |
parent | f6743fcaa4fbccd4bd8a92c44a3cd4bd2d153fd1 (diff) | |
parent | 2d3d76693a84224b86eac50729fb5a321753b7e3 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/python/intern/bpy_rna_anim.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna_anim.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 3bbeaea2674..192738535b4 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -234,13 +234,13 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb struct Depsgraph *depsgraph = CTX_data_depsgraph(BPy_GetContext()); ReportList reports; short result = 0; - + PointerRNA ptr = self->ptr; PropertyRNA *prop = NULL; const char *prop_name; - + BKE_reports_init(&reports, RPT_STORE); - + /* Retrieve the property identifier from the full path, since we can't get it any other way */ prop_name = strrchr(path_full, '.'); if ((prop_name >= path_full) && @@ -248,21 +248,21 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb { prop = RNA_struct_find_property(&ptr, prop_name + 1); } - + if (prop) { NlaStrip *strip = (NlaStrip *)ptr.data; FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index); - + 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); } MEM_freeN((void *)path_full); - + if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1) return NULL; - + return PyBool_FromLong(result); } else { @@ -322,13 +322,13 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb */ ReportList reports; short result = 0; - + PointerRNA ptr = self->ptr; PropertyRNA *prop = NULL; const char *prop_name; - + BKE_reports_init(&reports, RPT_STORE); - + /* Retrieve the property identifier from the full path, since we can't get it any other way */ prop_name = strrchr(path_full, '.'); if ((prop_name >= path_full) && @@ -336,14 +336,14 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb { prop = RNA_struct_find_property(&ptr, prop_name + 1); } - + if (prop) { ID *id = ptr.id.data; NlaStrip *strip = (NlaStrip *)ptr.data; FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index); - + BLI_assert(fcu != NULL); /* NOTE: This should be true, or else we wouldn't be able to get here */ - + if (BKE_fcurve_is_protected(fcu)) { BKE_reportf(&reports, RPT_WARNING, "Not deleting keyframe for locked F-Curve for NLA Strip influence on %s - %s '%s'", @@ -356,7 +356,7 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb */ bool found = false; int i; - + /* try to find index of beztriple to get rid of */ i = binarysearch_bezt_index(fcu->bezt, cfra, fcu->totvert, &found); if (found) { @@ -370,10 +370,10 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb BKE_reportf(&reports, RPT_ERROR, "Could not resolve path (%s)", path_full); } MEM_freeN((void *)path_full); - + if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1) return NULL; - + return PyBool_FromLong(result); } else { @@ -425,7 +425,7 @@ PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args) BKE_reports_init(&reports, RPT_STORE); - result = ANIM_add_driver(&reports, (ID *)self->ptr.id.data, path_full, index, + result = ANIM_add_driver(&reports, (ID *)self->ptr.id.data, path_full, index, CREATEDRIVER_WITH_FMODIFIER, DRIVER_TYPE_PYTHON); if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1) @@ -451,7 +451,7 @@ PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args) RNA_pointer_create(id, &RNA_FCurve, fcu, &tptr); ret = pyrna_struct_CreatePyObject(&tptr); } - + WM_event_add_notifier(BPy_GetContext(), NC_ANIMATION | ND_FCURVES_ORDER, NULL); } else { @@ -504,7 +504,7 @@ PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args) if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1) return NULL; - + WM_event_add_notifier(BPy_GetContext(), NC_ANIMATION | ND_FCURVES_ORDER, NULL); return PyBool_FromLong(result); |