diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-28 20:08:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-02-28 20:09:10 +0300 |
commit | 2215541967f6a476b9c0189d10c591cbc83879b3 (patch) | |
tree | 71d508cfa54d35c97a06a983248e6f0c3fed29fd /source/blender/editors/animation/keyframing.c | |
parent | 2cd478cf1971aa27c46dbe683354c3f2165dc548 (diff) |
Fix T62012: Non-animated property, stuck in previously keyframed values
Was missing ID recalc tag.
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 5e3880e2253..1922b876d1e 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1365,6 +1365,20 @@ static bool delete_keyframe_fcurve(AnimData *adt, FCurve *fcu, float cfra) return false; } +static void deg_tag_after_keyframe_delete(Main *bmain, ID *id, AnimData *adt) +{ + if (adt->action == NULL) { + /* In the case last f-curve wes removed need to inform dependency graph + * about relations update, since it needs to get rid of animation operation + * for this datablock. */ + DEG_id_tag_update_ex(bmain, id, ID_RECALC_COPY_ON_WRITE); + DEG_relations_tag_update(bmain); + } + else { + DEG_id_tag_update_ex(bmain, &adt->action->id, ID_RECALC_COPY_ON_WRITE); + } +} + short delete_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, eInsertKeyFlags UNUSED(flag)) @@ -1441,12 +1455,8 @@ short delete_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *act, ret += delete_keyframe_fcurve(adt, fcu, cfra); } - /* In the case last f-curve wes removed need to inform dependency graph - * about relations update, since it needs to get rid of animation operation - * for this datablock. */ - if (ret && adt->action == NULL) { - DEG_id_tag_update_ex(bmain, id, ID_RECALC_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); + if (ret) { + deg_tag_after_keyframe_delete(bmain, id, adt); } /* return success/failure */ return ret; @@ -1537,12 +1547,8 @@ static short clear_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *a /* return success */ ret++; } - /* In the case last f-curve wes removed need to inform dependency graph - * about relations update, since it needs to get rid of animation operation - * for this datablock. */ - if (ret && adt->action == NULL) { - DEG_id_tag_update_ex(bmain, id, ID_RECALC_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); + if (ret) { + deg_tag_after_keyframe_delete(bmain, id, adt); } /* return success/failure */ return ret; |