Mesh Animation + Depsgraph Tweaks:
[blender.git] / source / blender / editors / animation / anim_filter.c
index 392f435d017ff523360192cf738d41957256a93c..0b63dd73cdaee95af6016984e1c7d90d73b92dc1 100644 (file)
@@ -613,6 +613,19 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
                                ale->key_data= (adt) ? adt->action : NULL;
                                ale->datatype= ALE_ACT;
                                
+                               ale->adt= BKE_animdata_from_id(data);
+                       }
+                               break;
+                       case ANIMTYPE_DSMESH:
+                       {
+                               Mesh *me= (Mesh *)data;
+                               AnimData *adt= me->adt;
+                               
+                               ale->flag= FILTER_MESH_OBJD(me);
+                               
+                               ale->key_data= (adt) ? adt->action : NULL;
+                               ale->datatype= ALE_ACT;
+                               
                                ale->adt= BKE_animdata_from_id(data);
                        }
                                break;
@@ -1348,6 +1361,14 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
                        expanded= FILTER_ARM_OBJD(arm);
                }
                        break;
+               case OB_MESH: /* ------- Mesh ---------- */
+               {
+                       Mesh *me= (Mesh *)ob->data;
+                       
+                       type= ANIMTYPE_DSMESH;
+                       expanded= FILTER_MESH_OBJD(me);
+               }
+                       break;
        }
        
        /* special exception for drivers instead of action */
@@ -1582,6 +1603,19 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
                        }
                }
                        break;
+               case OB_MESH: /* ------- Mesh ---------- */
+               {
+                       Mesh *me= (Mesh *)ob->data;
+                       
+                       if ((ads->filterflag & ADS_FILTER_NOMESH) == 0) {
+                               ANIMDATA_FILTER_CASES(me,
+                                       { /* AnimData blocks - do nothing... */ },
+                                       obdata_ok= 1;,
+                                       obdata_ok= 1;,
+                                       obdata_ok= 1;)
+                       }
+               }
+                       break;
        }
        if (obdata_ok) 
                items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode);
@@ -2018,6 +2052,23 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDo
                                                        dataOk= !(ads->filterflag & ADS_FILTER_NOARM);)
                                        }
                                                break;
+                                       case OB_MESH: /* ------- Mesh ---------- */
+                                       {
+                                               Mesh *me= (Mesh *)ob->data;
+                                               dataOk= 0;
+                                               ANIMDATA_FILTER_CASES(me, 
+                                                       if ((ads->filterflag & ADS_FILTER_NOMESH)==0) {
+                                                               /* for the special AnimData blocks only case, we only need to add
+                                                                * the block if it is valid... then other cases just get skipped (hence ok=0)
+                                                                */
+                                                               ANIMDATA_ADD_ANIMDATA(me);
+                                                               dataOk=0;
+                                                       },
+                                                       dataOk= !(ads->filterflag & ADS_FILTER_NOMESH);, 
+                                                       dataOk= !(ads->filterflag & ADS_FILTER_NOMESH);, 
+                                                       dataOk= !(ads->filterflag & ADS_FILTER_NOMESH);)
+                                       }
+                                               break;
                                        default: /* --- other --- */
                                                dataOk= 0;
                                                break;
@@ -2108,6 +2159,12 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDo
                                                dataOk= ANIMDATA_HAS_KEYS(arm); 
                                        }
                                                break;
+                                       case OB_MESH: /* -------- Mesh ---------- */
+                                       {
+                                               Mesh *me= (Mesh *)ob->data;
+                                               dataOk= ANIMDATA_HAS_KEYS(me);  
+                                       }
+                                               break;
                                        default: /* --- other --- */
                                                dataOk= 0;
                                                break;