diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-08-03 17:09:23 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-08-03 17:09:23 +0400 |
commit | 641c8e69a82fc8f674f81948e329cae334ef60fc (patch) | |
tree | 9e67c1672c83d49a728f28da3a7ca48dd5f6d558 /source/blender/editors/animation | |
parent | cd905eef702555b27d4d90983b079a1a62c31fb8 (diff) |
2.5 - MetaBalls are now animateable
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels.c | 21 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 47 |
2 files changed, 66 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index f518b5b0a2e..235a3039b2c 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -56,6 +56,7 @@ #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" +#include "DNA_meta_types.h" #include "DNA_userdef_types.h" #include "DNA_gpencil_types.h" #include "DNA_windowmanager_types.h" @@ -1066,7 +1067,7 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, case ANIMTYPE_DSPART: { ParticleSettings *part= (ParticleSettings*)ale->data; - + if (ASUBCHANNEL_SEL_OK(ale)) { if (setting == ACHANNEL_SETTING_EXPAND) { ACHANNEL_SET_FLAG(part, mode, PART_DS_EXPAND); @@ -1074,6 +1075,17 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, } } break; + case ANIMTYPE_DSMBALL: + { + MetaBall *mb= (MetaBall *)ale->data; + + if (ASUBCHANNEL_SEL_OK(ale)) { + if (setting == ACHANNEL_SETTING_EXPAND) { + ACHANNEL_SET_FLAG(mb, mode, MB_DS_EXPAND); + } + } + } + break; case ANIMTYPE_GROUP: { @@ -1688,6 +1700,13 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh notifierFlags |= ND_ANIMCHAN_EDIT; } break; + case ANIMTYPE_DSMBALL: + { + MetaBall *mb= (MetaBall *)ale->data; + mb->flag2 ^= MB_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; + } + break; case ANIMTYPE_GROUP: { diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 4e479bd75d0..4797c7946a4 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -62,6 +62,7 @@ #include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_meta_types.h" #include "DNA_object_types.h" #include "DNA_particle_types.h" #include "DNA_space_types.h" @@ -1090,6 +1091,14 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad expanded= FILTER_CUR_OBJD(cu); } break; + case OB_MBALL: /* ------- MetaBall ---------- */ + { + MetaBall *mb= (MetaBall *)ob->data; + + type= ANIMTYPE_DSMBALL; + expanded= FILTER_MBALL_OBJD(mb); + } + break; } /* special exception for drivers instead of action */ @@ -1273,12 +1282,25 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B } } break; + case OB_MBALL: /* ------- MetaBall ---------- */ + { + MetaBall *mb= (MetaBall *)ob->data; + + if ((ads->filterflag & ADS_FILTER_NOMBA) == 0) { + ANIMDATA_FILTER_CASES(mb, + { /* 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); /* particles */ - if(ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART)) + if (ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART)) items += animdata_filter_dopesheet_particles(anim_data, ads, base, filter_mode); /* return the number of items added to the list */ @@ -1595,6 +1617,23 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int dataOk= !(ads->filterflag & ADS_FILTER_NOCUR);) } break; + case OB_MBALL: /* ------- MetaBall ---------- */ + { + MetaBall *mb= (MetaBall *)ob->data; + dataOk= 0; + ANIMDATA_FILTER_CASES(mb, + if ((ads->filterflag & ADS_FILTER_NOMBA)==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(mb); + dataOk=0; + }, + dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);, + dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);, + dataOk= !(ads->filterflag & ADS_FILTER_NOMBA);) + } + break; default: /* --- other --- */ dataOk= 0; break; @@ -1671,6 +1710,12 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int dataOk= ANIMDATA_HAS_KEYS(cu); } break; + case OB_MBALL: /* -------- Metas ---------- */ + { + MetaBall *mb= (MetaBall *)ob->data; + dataOk= ANIMDATA_HAS_KEYS(mb); + } + break; default: /* --- other --- */ dataOk= 0; break; |