[Bf-blender-cvs] [8447f45f097] master: Fix T74292: Dope sheet (Mask mode) keyframe editing misses update

Sybren A. Stüvel noreply at git.blender.org
Tue Mar 3 05:51:48 CET 2020


Commit: 8447f45f09761c5f75b1ac76b7ad99c901680052
Author: Sybren A. Stüvel
Date:   Tue Mar 3 15:48:00 2020 +1100
Branches: master
https://developer.blender.org/rB8447f45f09761c5f75b1ac76b7ad99c901680052

Fix T74292: Dope sheet (Mask mode) keyframe editing misses update

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

M	source/blender/editors/animation/anim_deps.c
M	source/blender/editors/transform/transform_convert.c

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

diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index 5c9f0707aa9..0a93351fefd 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -30,6 +30,7 @@
 #include "DNA_gpencil_types.h"
 #include "DNA_object_types.h"
 #include "DNA_node_types.h"
+#include "DNA_mask_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_sequence_types.h"
 
@@ -360,16 +361,6 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
 {
   bAnimListElem *ale;
 
-  if (ELEM(ac->datatype, ANIMCONT_MASK)) {
-#ifdef DEBUG
-    /* quiet assert */
-    for (ale = anim_data->first; ale; ale = ale->next) {
-      ale->update = 0;
-    }
-#endif
-    return;
-  }
-
   for (ale = anim_data->first; ale; ale = ale->next) {
     if (ale->type == ANIMTYPE_GPLAYER) {
       bGPDlayer *gpl = ale->data;
@@ -377,6 +368,8 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
       if (ale->update & ANIM_UPDATE_ORDER) {
         ale->update &= ~ANIM_UPDATE_ORDER;
         if (gpl) {
+          /* While correct & we could enable it: 'posttrans_gpd_clean'
+           * currently handles as well as removing doubles. */
           // gpencil_sort_frames(gpl);
         }
       }
@@ -390,6 +383,27 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
         ale->update &= ~ANIM_UPDATE_HANDLES;
       }
     }
+    else if (ale->datatype == ALE_MASKLAY) {
+      MaskLayer *masklay = ale->data;
+
+      if (ale->update & ANIM_UPDATE_ORDER) {
+        ale->update &= ~ANIM_UPDATE_ORDER;
+        if (masklay) {
+          /* While correct & we could enable it: 'posttrans_mask_clean'
+           * currently handles as well as removing doubles. */
+          // BKE_mask_layer_shape_sort(masklay);
+        }
+      }
+
+      if (ale->update & ANIM_UPDATE_DEPS) {
+        ale->update &= ~ANIM_UPDATE_DEPS;
+        ANIM_list_elem_update(ac->bmain, ac->scene, ale);
+      }
+      /* Disable handles to avoid assert. */
+      if (ale->update & ANIM_UPDATE_HANDLES) {
+        ale->update &= ~ANIM_UPDATE_HANDLES;
+      }
+    }
     else if (ale->datatype == ALE_FCURVE) {
       FCurve *fcu = ale->key_data;
 
diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c
index c2e3c8ef508..3e3e780dede 100644
--- a/source/blender/editors/transform/transform_convert.c
+++ b/source/blender/editors/transform/transform_convert.c
@@ -2094,7 +2094,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
     }
 
     /* make sure all F-Curves are set correctly */
-    if (!ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
+    if (!ELEM(ac.datatype, ANIMCONT_GPENCIL)) {
       ANIM_editkeyframes_refresh(&ac);
     }



More information about the Bf-blender-cvs mailing list