Commit: 2215541967f6a476b9c0189d10c591cbc83879b3
Author: Sergey Sharybin
Date:   Thu Feb 28 18:08:22 2019 +0100
Branches: master
https://developer.blender.org/rB2215541967f6a476b9c0189d10c591cbc83879b3

Fix T62012: Non-animated property, stuck in previously keyframed values

Was missing ID recalc tag.

===================================================================

M       source/blender/editors/animation/keyframing.c

===================================================================

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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to