Mesh Animation + Depsgraph Tweaks:
authorJoshua Leung <aligorith@gmail.com>
Mon, 28 Dec 2009 00:52:31 +0000 (00:52 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 28 Dec 2009 00:52:31 +0000 (00:52 +0000)
* Mesh data/settings can now be animated. It is not recommended that geometry be animated directly, but other settings such as autosmooth, etc. can be...

* Code cleanups for depsgraph, making sure that drivers get included for all object data types.

15 files changed:
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/object.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/interface/interface_templates.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_mesh_types.h
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_mesh.c

index a6f733708c7ff7216c0c4c94901a84c8ca1958c5..4f96b031daa00f2e9d114fdae3ab148499bef66d 100644 (file)
@@ -72,7 +72,7 @@ static short id_has_animdata (ID *id)
        switch (GS(id->name)) {
                        /* has AnimData */
                case ID_OB:
-               case ID_MB: case ID_CU: case ID_AR:
+               case ID_ME: case ID_MB: case ID_CU: case ID_AR:
                case ID_KE:
                case ID_PA:
                case ID_MA: case ID_TE: case ID_NT:
@@ -1774,7 +1774,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
        EVAL_ANIM_IDS(main->armature.first, ADT_RECALC_ANIM);
        
        /* meshes */
-       // TODO...
+       EVAL_ANIM_IDS(main->mesh.first, ADT_RECALC_ANIM);
        
        /* particles */
        EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM);
index aaaf54b322582f0447b0d4d508d2607eea146657..2f08abd82b37fa18b39403285b74fba5b2113f32 100644 (file)
@@ -491,22 +491,6 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                /* inverted relation, so addtoroot shouldn't be set to zero */
        }
        
-
-       if (ob->type==OB_CAMERA) {
-               Camera *cam = (Camera *)ob->data;
-               if (cam->adt)
-                       dag_add_driver_relation(cam->adt, dag, node, 1);
-               if (cam->dof_ob) {
-                       node2 = dag_get_node(dag, cam->dof_ob);
-                       dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Camera DoF");
-               }
-       }
-       if (ob->type==OB_LAMP) {
-               Lamp *la = (Lamp *)ob->data;
-               if (la->adt)
-                       dag_add_driver_relation(la->adt, dag, node, 1);
-       }
-       
        if (ob->transflag & OB_DUPLI) {
                if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) {
                        GroupObject *go;
@@ -521,38 +505,67 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
        }
     
        /* softbody collision  */
-       if((ob->type==OB_MESH) || (ob->type==OB_CURVE) || (ob->type==OB_LATTICE))
+       if ((ob->type==OB_MESH) || (ob->type==OB_CURVE) || (ob->type==OB_LATTICE)) {
                if(modifiers_isSoftbodyEnabled(ob) || modifiers_isClothEnabled(ob) || ob->particlesystem.first)
                        dag_add_collision_field_relation(dag, scene, ob, node); /* TODO: use effectorweight->group */
-               
-       if (ob->type==OB_MBALL) {
-               Object *mom= find_basis_mball(scene, ob);
-               if(mom!=ob) {
-                       node2 = dag_get_node(dag, mom);
-                       dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball");  // mom depends on children!
-               }
        }
-       else if (ob->type==OB_CURVE) {
-               Curve *cu= ob->data;
-               if(cu->bevobj) {
-                       node2 = dag_get_node(dag, cu->bevobj);
-                       dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
+       
+       /* object data drivers */
+       if (ob->data) {
+               AnimData *adt= BKE_animdata_from_id((ID *)ob->data);
+               if (adt)
+                       dag_add_driver_relation(adt, dag, node, 1);
+       }
+       
+       /* object type/data relationships */
+       switch (ob->type) {
+               case OB_CAMERA:
+               {
+                       Camera *cam = (Camera *)ob->data;
+                       
+                       if (cam->dof_ob) {
+                               node2 = dag_get_node(dag, cam->dof_ob);
+                               dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Camera DoF");
+                       }
                }
-               if(cu->taperobj) {
-                       node2 = dag_get_node(dag, cu->taperobj);
-                       dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
+                       break;
+               case OB_MBALL: 
+               {
+                       Object *mom= find_basis_mball(scene, ob);
+                       
+                       if(mom!=ob) {
+                               node2 = dag_get_node(dag, mom);
+                               dag_add_relation(dag,node,node2,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Metaball");  // mom depends on children!
+                       }
                }
-               if (cu->adt)
-                       dag_add_driver_relation(cu->adt, dag, node, 1);
-       }
-       else if(ob->type==OB_FONT) {
-               Curve *cu= ob->data;
-               if(cu->textoncurve) {
-                       node2 = dag_get_node(dag, cu->textoncurve);
-                       dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
+                       break;
+               case OB_CURVE:
+               {
+                       Curve *cu= ob->data;
+                       
+                       if(cu->bevobj) {
+                               node2 = dag_get_node(dag, cu->bevobj);
+                               dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Bevel");
+                       }
+                       if(cu->taperobj) {
+                               node2 = dag_get_node(dag, cu->taperobj);
+                               dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Curve Taper");
+                       }
+               }
+                       break;
+               case OB_FONT: 
+               {
+                       Curve *cu= ob->data;
+                       
+                       if(cu->textoncurve) {
+                               node2 = dag_get_node(dag, cu->textoncurve);
+                               dag_add_relation(dag,node2,node,DAG_RL_DATA_DATA|DAG_RL_OB_DATA, "Texture On Curve");
+                       }
                }
+                       break;
        }
        
+       /* particles */
        psys= ob->particlesystem.first;
        if(psys) {
                GroupObject *go;
@@ -624,6 +637,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                }
        }
        
+       /* object constraints */
        for (con = ob->constraints.first; con; con=con->next) {
                bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
                ListBase targets = {NULL, NULL};
index d5c597b802c9085a5ba4880c636adde4340ba048..0b48d5bd0adcfd6d5787bf5d43464bd45dfeabed 100644 (file)
@@ -143,7 +143,12 @@ void free_mesh(Mesh *me)
        CustomData_free(&me->vdata, me->totvert);
        CustomData_free(&me->edata, me->totedge);
        CustomData_free(&me->fdata, me->totface);
-
+       
+       if(me->adt) {
+               BKE_free_animdata(&me->id);
+               me->adt= NULL;
+       }
+       
        if(me->mat) MEM_freeN(me->mat);
        
        if(me->bb) MEM_freeN(me->bb);
index 676ab0815334b358801bc6195d3160e72071799e..06ae987418092460b56ebdcf1e24cc78fbe55da5 100644 (file)
@@ -2396,7 +2396,11 @@ void object_handle_update(Scene *scene, Object *ob)
                        /* includes all keys and modifiers */
                        if(ob->type==OB_MESH) {
                                EditMesh *em = BKE_mesh_get_editmesh(ob->data);
-
+                               
+                               /* evaluate drivers */
+                               // XXX: should we push this to derivedmesh instead?
+                               BKE_animsys_evaluate_animdata(data_id, adt, ctime, ADT_RECALC_DRIVERS);
+                               
                                        // here was vieweditdatamask? XXX
                                if(ob->mode & OB_MODE_EDIT) {
                                        makeDerivedMesh(scene, ob, em, CD_MASK_BAREMESH);
index 5398238a43bc319fb285f4a37b667c2a2ed37d7a..aa0fcab3e36a82136dbcecad7f39576fb11975d1 100644 (file)
@@ -53,6 +53,7 @@
 #include "DNA_constraint_types.h"
 #include "DNA_key_types.h"
 #include "DNA_lamp_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_material_types.h"
 #include "DNA_meta_types.h"
 #include "DNA_node_types.h"
@@ -1820,6 +1821,78 @@ static bAnimChannelType ACF_DSNTREE=
        acf_dsntree_setting_ptr                                 /* pointer for setting */
 };
 
+/* Mesh Expander  ------------------------------------------- */
+
+// TODO: just get this from RNA?
+static int acf_dsmesh_icon(bAnimListElem *ale)
+{
+       return ICON_MESH_DATA;
+}
+
+/* get the appropriate flag(s) for the setting when it is valid  */
+static int acf_dsmesh_setting_flag(int setting, short *neg)
+{
+       /* clear extra return data first */
+       *neg= 0;
+       
+       switch (setting) {
+               case ACHANNEL_SETTING_EXPAND: /* expanded */
+                       return ME_DS_EXPAND;
+                       
+               case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
+                       return ADT_NLA_EVAL_OFF;
+                       
+               case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */
+                       *neg= 1;
+                       return ADT_CURVES_NOT_VISIBLE;
+                       
+               case ACHANNEL_SETTING_SELECT: /* selected */
+                       return ADT_UI_SELECTED;
+                       
+               default: /* unsupported */
+                       return 0;
+       }
+}
+
+/* get pointer to the setting */
+static void *acf_dsmesh_setting_ptr(bAnimListElem *ale, int setting, short *type)
+{
+       Mesh *me= (Mesh *)ale->data;
+       
+       /* clear extra return data first */
+       *type= 0;
+       
+       switch (setting) {
+               case ACHANNEL_SETTING_EXPAND: /* expanded */
+                       GET_ACF_FLAG_PTR(me->flag);
+                       
+               case ACHANNEL_SETTING_SELECT: /* selected */
+               case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
+               case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+                       if (me->adt)
+                               GET_ACF_FLAG_PTR(me->adt->flag)
+                               else
+                                       return NULL;
+                       
+               default: /* unsupported */
+                       return NULL;
+       }
+}
+
+/* node tree expander type define */
+static bAnimChannelType ACF_DSMESH= 
+{
+       acf_generic_dataexpand_backdrop,/* backdrop */
+       acf_generic_indention_1,                /* indent level */              // XXX this only works for compositing
+       acf_generic_basic_offset,               /* offset */
+       
+       acf_generic_idblock_name,               /* name */
+       acf_dsmesh_icon,                                /* icon */
+       
+       acf_generic_dataexpand_setting_valid,   /* has setting */
+       acf_dsmesh_setting_flag,                                /* flag for setting */
+       acf_dsmesh_setting_ptr                                  /* pointer for setting */
+};
 
 /* ShapeKey Entry  ------------------------------------------- */
 
@@ -2071,6 +2144,7 @@ void ANIM_init_channel_typeinfo_data (void)
                animchannelTypeInfo[type++]= &ACF_DSPART;               /* Particle Channel */
                animchannelTypeInfo[type++]= &ACF_DSMBALL;              /* MetaBall Channel */
                animchannelTypeInfo[type++]= &ACF_DSARM;                /* Armature Channel */
+               animchannelTypeInfo[type++]= &ACF_DSMESH;               /* Mesh Channel */
                
                animchannelTypeInfo[type++]= &ACF_SHAPEKEY;             /* ShapeKey */
                
index 0c77c2b001013e1cd339fb2447ad3bbb51eec405..ebb3136d530ed80e4f0923a3811696e82f404ce7 100644 (file)
@@ -142,6 +142,7 @@ void ANIM_set_active_channel (bAnimContext *ac, void *data, short datatype, int
                        case ANIMTYPE_DSPART:
                        case ANIMTYPE_DSMBALL:
                        case ANIMTYPE_DSARM:
+                       case ANIMTYPE_DSMESH:
                        {
                                /* need to verify that this data is valid for now */
                                if (ale->adt) {
@@ -184,6 +185,7 @@ void ANIM_set_active_channel (bAnimContext *ac, void *data, short datatype, int
                        case ANIMTYPE_DSPART:
                        case ANIMTYPE_DSMBALL:
                        case ANIMTYPE_DSARM:
+                       case ANIMTYPE_DSMESH:
                        {
                                /* need to verify that this data is valid for now */
                                if (ale->adt)
@@ -257,6 +259,7 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short
                                case ANIMTYPE_DSPART:
                                case ANIMTYPE_DSMBALL:
                                case ANIMTYPE_DSARM:
+                               case ANIMTYPE_DSMESH:
                                {
                                        if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED))
                                                sel= ACHANNEL_SETFLAG_CLEAR;
@@ -337,6 +340,7 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short
                        case ANIMTYPE_DSPART:
                        case ANIMTYPE_DSMBALL:
                        case ANIMTYPE_DSARM:
+                       case ANIMTYPE_DSMESH:
                        {
                                /* need to verify that this data is valid for now */
                                if (ale->adt) {
@@ -1651,6 +1655,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
                case ANIMTYPE_DSPART:
                case ANIMTYPE_DSMBALL:
                case ANIMTYPE_DSARM:
+               case ANIMTYPE_DSMESH:
                {
                        /* sanity checking... */
                        if (ale->adt) {
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;
index 631cec87c967ad324da20ee3f6166ab93bf296a1..42fe9160946ead6cdf9118e29b392588e7130146 100644 (file)
@@ -56,6 +56,7 @@
 #include "DNA_space_types.h"
 #include "DNA_key_types.h"
 #include "DNA_lamp_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_material_types.h"
 #include "DNA_meta_types.h"
 #include "DNA_node_types.h"
@@ -822,6 +823,14 @@ void ob_to_keylist(bDopeSheet *ads, Object *ob, DLRBT_Tree *keys, DLRBT_Tree *bl
                                action_to_keylist(arm->adt, arm->adt->action, keys, blocks);
                }
                        break;
+               case OB_MESH: /* ------- Mesh ---------- */
+               {
+                       Mesh *me= (Mesh *)ob->data;
+                       
+                       if ((me->adt) && !(filterflag & ADS_FILTER_NOMESH)) 
+                               action_to_keylist(me->adt, me->adt->action, keys, blocks);
+               }
+                       break;
        }
        
        /* Add Particle System Keyframes */
index 039041d1efdd69abe7656457839254afc27cb692..b3b0d6308a73d6dc363bae0ec6d3f62b1cac01e5 100644 (file)
@@ -41,6 +41,7 @@
 #include "DNA_curve_types.h"
 #include "DNA_key_types.h"
 #include "DNA_lamp_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_material_types.h"
 #include "DNA_object_types.h"
 #include "DNA_meta_types.h"
@@ -285,6 +286,16 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez
                        }
                }
                        break;
+               case OB_MESH: /* ------- Mesh ---------- */
+               {
+                       Mesh *me= (Mesh *)ob->data;
+                       
+                       if ((me->adt) && !(filterflag & ADS_FILTER_NOMESH)) {
+                               if (adt_keys_bezier_loop(bed, me->adt, bezt_ok, bezt_cb, fcu_cb, filterflag))
+                                       return 1;
+                       }
+               }
+                       break;
        }
        
        /* Add Particle System Keyframes */
index b971abac9954ffe9ee6c29ba032cb3de47026d7c..c34885fbe6b8a76619f73704a9b29ba74fc49cc2 100644 (file)
@@ -144,6 +144,7 @@ typedef enum eAnim_ChannelType {
        ANIMTYPE_DSPART,
        ANIMTYPE_DSMBALL,
        ANIMTYPE_DSARM,
+       ANIMTYPE_DSMESH,
        
        ANIMTYPE_SHAPEKEY,
        
@@ -219,6 +220,7 @@ typedef enum eAnimFilter_Flags {
 #define FILTER_PART_OBJD(part) ((part->flag & PART_DS_EXPAND))
 #define FILTER_MBALL_OBJD(mb) ((mb->flag2 & MB_DS_EXPAND))
 #define FILTER_ARM_OBJD(arm) ((arm->flag & ARM_DS_EXPAND))
+#define FILTER_MESH_OBJD(me) ((me->flag & ME_DS_EXPAND))
        /* 'Sub-object/Action' channels (flags stored in Action) */
 #define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED))
 #define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED)==0)
index d2b58e61757772865817fea35fe55f8319f13fc0..f89c267112b2f9be202a15fc10adbcb704910d29 100644 (file)
@@ -94,6 +94,8 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr)
        uiItemR(row, "", 0, ptr, "display_world", 0);
        uiItemR(row, "", 0, ptr, "display_node", 0);
 
+       if (mainptr && mainptr->mesh.first)
+               uiItemR(row, "", 0, ptr, "display_mesh", 0);
        if (mainptr && mainptr->key.first)
                uiItemR(row, "", 0, ptr, "display_shapekeys", 0);
        if (mainptr && mainptr->mat.first)
index ee6af076f59b6be22cc98c64efbc2ef9a1f7a38c..9847b3a92192af3e092f0848c7dd7c62628768b1 100644 (file)
@@ -425,7 +425,7 @@ typedef struct bDopeSheet {
 
 
 /* DopeSheet filter-flag */
-typedef enum DOPESHEET_FILTERFLAG {
+typedef enum eDopeSheet_FilterFlag {
                /* general filtering */
        ADS_FILTER_ONLYSEL                      = (1<<0),       /* only include channels relating to selected data */
        
@@ -437,6 +437,7 @@ typedef enum DOPESHEET_FILTERFLAG {
        
                /* datatype-based filtering */
        ADS_FILTER_NOSHAPEKEYS          = (1<<6),
+       ADS_FILTER_NOMESH                       = (1<<7),
        ADS_FILTER_NOCAM                        = (1<<10),
        ADS_FILTER_NOMAT                        = (1<<11),
        ADS_FILTER_NOLAM                        = (1<<12),
@@ -449,16 +450,16 @@ typedef enum DOPESHEET_FILTERFLAG {
        ADS_FILTER_NONTREE                      = (1<<19),
        
                /* NLA-specific filters */
-       ADS_FILTER_NLA_NOACT            = (1<<20),      /* if the AnimData block has no NLA data, don't include to just show Action-line */
+       ADS_FILTER_NLA_NOACT            = (1<<25),      /* if the AnimData block has no NLA data, don't include to just show Action-line */
        
                /* combination filters (some only used at runtime) */
        ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR|ADS_FILTER_NOPART|ADS_FILTER_NOARM),
-} DOPESHEET_FILTERFLAG;        
+} eDopeSheet_FilterFlag;       
 
 /* DopeSheet general flags */
-typedef enum DOPESHEET_FLAG {
+typedef enum eDopeSheet_Flag {
        ADS_FLAG_SUMMARY_COLLAPSED      = (1<<0),       /* when summary is shown, it is collapsed, so all other channels get hidden */
-} DOPESHEET_FLAG;
+} eDopeSheet_Flag;
 
 
 
index d12d81bb9f723949d38ff4450ae97f99c180228c..fae89284e32298ecaaecd2c3ae2f793cb5fa105b 100644 (file)
@@ -47,15 +47,17 @@ struct OcInfo;
 struct Multires;
 struct PartialVisibility;
 struct EditMesh;
+struct AnimData;
 
 typedef struct Mesh {
        ID id;
+       struct AnimData *adt;           /* animation data (must be immediately after id for utilities to use it) */
 
        struct BoundBox *bb;
 
        ListBase effect;
        
-       struct Ipo *ipo;
+       struct Ipo *ipo;                // XXX depreceated... old animation system
        struct Key *key;
        struct Material **mat;
 
@@ -133,6 +135,7 @@ typedef struct TFace {
 #define ME_SMESH               64
 #define ME_SUBSURF             128
 #define ME_OPT_EDGES   256
+#define ME_DS_EXPAND   512
 
 /* me->drawflag, int */ 
 #define ME_DRAWEDGES   (1 << 0)
index 3f6729136d5cbed2b44e2cca5b94d7e26cc8693d..74194e8ee6cd7d35f73423d321b33cbca7f2f4bc 100644 (file)
@@ -94,10 +94,16 @@ static void rna_def_dopesheet(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "display_shapekeys", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
-       RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of Shapekey related Animation data.");
+       RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data.");
        RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
        RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
 
+       prop= RNA_def_property(srna, "display_meshes", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH);
+       RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data.");
+       RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);
+       RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+       
        prop= RNA_def_property(srna, "display_camera", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM);
        RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data.");
index c298d83850b0a24ad2494b9c97163a6dc5767457..528544d09dd16305f28b201afbfe00b861ea93fd 100644 (file)
@@ -1798,7 +1798,8 @@ static void rna_def_mesh(BlenderRNA *brna)
        RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
        RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
 
-
+       /* pointers */
+       rna_def_animdata_common(srna);
        rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
 
        RNA_api_mesh(srna);