Durian Request: Expansion of Action Groups not linked between DopeSheet editors and the Graph Editor

Action Groups can now be expanded/collapsed in DopeSheet editors without the same thing happening in the Graph Editor, and visa versa. 

This should help improve the workflow, since the channel lists are generally kept more compact in the DopeSheet, while they are more expanded in the Graph Editor, so less time is spent expanding/collapsing stuff. Also this should hopefully alleviate some of the errors from accidentally deleting and then having to restore channels that were not intended to be deleted.

Also, switched the order of the expand/collapse hotkeys (in the channels list region) for channels so that Ctrl +/- now expands/collapses selected channels only, while +/- expands/collapses all channels. This should make it more convenient to quickly open up all groups to select F-Curves for the Graph Editor.
This commit is contained in:
Joshua Leung
2010-01-23 03:04:37 +00:00
parent 2f6a158d21
commit 42c8448fe6
9 changed files with 103 additions and 90 deletions

View File

@@ -429,7 +429,7 @@ static short acf_summary_setting_valid(bAnimContext *ac, bAnimListElem *ale, int
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_summary_setting_flag(int setting, short *neg)
static int acf_summary_setting_flag(bAnimContext *ac, int setting, short *neg)
{
if (setting == ACHANNEL_SETTING_EXPAND) {
/* expanded */
@@ -512,7 +512,7 @@ static short acf_scene_setting_valid(bAnimContext *ac, bAnimListElem *ale, int s
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_scene_setting_flag(int setting, short *neg)
static int acf_scene_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -631,7 +631,7 @@ static short acf_object_setting_valid(bAnimContext *ac, bAnimListElem *ale, int
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_object_setting_flag(int setting, short *neg)
static int acf_object_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -754,7 +754,7 @@ static short acf_group_setting_valid(bAnimContext *ac, bAnimListElem *ale, int s
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_group_setting_flag(int setting, short *neg)
static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -764,7 +764,15 @@ static int acf_group_setting_flag(int setting, short *neg)
return AGRP_SELECTED;
case ACHANNEL_SETTING_EXPAND: /* expanded */
return AGRP_EXPANDED;
{
/* NOTE: Graph Editor uses a different flag to everywhere else for this,
* allowing different collapsing of groups there, since sharing the flag
* proved to be a hazard for workflows...
*/
return (ac->spacetype == SPACE_IPO) ?
AGRP_EXPANDED_G : /* Graph Editor case */
AGRP_EXPANDED; /* DopeSheet and elsewhere */
}
case ACHANNEL_SETTING_MUTE: /* muted */
return AGRP_MUTED;
@@ -842,7 +850,7 @@ static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_fcurve_setting_flag(int setting, short *neg)
static int acf_fcurve_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -914,7 +922,7 @@ static short acf_fillactd_setting_valid(bAnimContext *ac, bAnimListElem *ale, in
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_fillactd_setting_flag(int setting, short *neg)
static int acf_fillactd_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1001,7 +1009,7 @@ static short acf_filldrivers_setting_valid(bAnimContext *ac, bAnimListElem *ale,
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_filldrivers_setting_flag(int setting, short *neg)
static int acf_filldrivers_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1063,7 +1071,7 @@ static void acf_fillmatd_name(bAnimListElem *ale, char *name)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_fillmatd_setting_flag(int setting, short *neg)
static int acf_fillmatd_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1107,7 +1115,7 @@ static void acf_fillpartd_name(bAnimListElem *ale, char *name)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_fillpartd_setting_flag(int setting, short *neg)
static int acf_fillpartd_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1152,7 +1160,7 @@ static short acf_dsmat_offset(bAnimContext *ac, bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dsmat_setting_flag(int setting, short *neg)
static int acf_dsmat_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1226,7 +1234,7 @@ static int acf_dslam_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dslam_setting_flag(int setting, short *neg)
static int acf_dslam_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1300,7 +1308,7 @@ static int acf_dscam_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dscam_setting_flag(int setting, short *neg)
static int acf_dscam_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1384,7 +1392,7 @@ static int acf_dscur_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dscur_setting_flag(int setting, short *neg)
static int acf_dscur_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1458,7 +1466,7 @@ static int acf_dsskey_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dsskey_setting_flag(int setting, short *neg)
static int acf_dsskey_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1532,7 +1540,7 @@ static int acf_dswor_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dswor_setting_flag(int setting, short *neg)
static int acf_dswor_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1606,7 +1614,7 @@ static int acf_dspart_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dspart_setting_flag(int setting, short *neg)
static int acf_dspart_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1680,7 +1688,7 @@ static int acf_dsmball_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dsmball_setting_flag(int setting, short *neg)
static int acf_dsmball_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1754,7 +1762,7 @@ static int acf_dsarm_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dsarm_setting_flag(int setting, short *neg)
static int acf_dsarm_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1828,7 +1836,7 @@ static int acf_dsntree_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dsntree_setting_flag(int setting, short *neg)
static int acf_dsntree_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -1902,7 +1910,7 @@ static int acf_dsmesh_icon(bAnimListElem *ale)
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_dsmesh_setting_flag(int setting, short *neg)
static int acf_dsmesh_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -2000,7 +2008,7 @@ static short acf_shapekey_setting_valid(bAnimContext *ac, bAnimListElem *ale, in
}
/* get the appropriate flag(s) for the setting when it is valid */
static int acf_shapekey_setting_flag(int setting, short *neg)
static int acf_shapekey_setting_flag(bAnimContext *ac, int setting, short *neg)
{
/* clear extra return data first */
*neg= 0;
@@ -2267,7 +2275,7 @@ short ANIM_channel_setting_get (bAnimContext *ac, bAnimListElem *ale, int settin
int flag;
void *ptr;
flag= acf->setting_flag(setting, &negflag);
flag= acf->setting_flag(ac, setting, &negflag);
ptr= acf->setting_ptr(ale, setting, &ptrsize);
/* check if flag is enabled */
@@ -2345,7 +2353,7 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting
int flag;
void *ptr;
flag= acf->setting_flag(setting, &negflag);
flag= acf->setting_flag(ac, setting, &negflag);
ptr= acf->setting_ptr(ale, setting, &ptrsize);
/* check if flag is enabled */
@@ -2691,7 +2699,7 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan
uiBut *but = NULL;
/* get the flag and the pointer to that flag */
flag= acf->setting_flag(setting, &negflag);
flag= acf->setting_flag(ac, setting, &negflag);
ptr= acf->setting_ptr(ale, setting, &ptrsize);
enabled= ANIM_channel_setting_get(ac, ale, setting);

View File

@@ -205,7 +205,7 @@ void ANIM_set_active_channel (bAnimContext *ac, void *data, short datatype, int
* - test: check if deselecting instead of selecting
* - sel: eAnimChannels_SetFlag;
*/
void ANIM_deselect_anim_channels (void *data, short datatype, short test, short sel)
void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype, short test, short sel)
{
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
@@ -213,7 +213,7 @@ void ANIM_deselect_anim_channels (void *data, short datatype, short test, short
/* filter data */
filter= ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS;
ANIM_animdata_filter(NULL, &anim_data, filter, data, datatype);
ANIM_animdata_filter(ac, &anim_data, filter, data, datatype);
/* See if we should be selecting or deselecting */
if (test) {
@@ -1368,7 +1368,7 @@ void ANIM_OT_channels_expand (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "all", 0, "All", "Expand all channels (not just selected ones)");
RNA_def_boolean(ot->srna, "all", 1, "All", "Expand all channels (not just selected ones)");
}
/* ********************** Collapse Channels Operator *********************** */
@@ -1410,7 +1410,7 @@ void ANIM_OT_channels_collapse (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* props */
RNA_def_boolean(ot->srna, "all", 0, "All", "Collapse all channels (not just selected ones)");
RNA_def_boolean(ot->srna, "all", 1, "All", "Collapse all channels (not just selected ones)");
}
/* ********************** Select All Operator *********************** */
@@ -1425,9 +1425,9 @@ static int animchannels_deselectall_exec(bContext *C, wmOperator *op)
/* 'standard' behaviour - check if selected, then apply relevant selection */
if (RNA_boolean_get(op->ptr, "invert"))
ANIM_deselect_anim_channels(ac.data, ac.datatype, 0, ACHANNEL_SETFLAG_TOGGLE);
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 0, ACHANNEL_SETFLAG_TOGGLE);
else
ANIM_deselect_anim_channels(ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_ADD);
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_ADD);
/* send notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL);
@@ -1676,7 +1676,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
}
else {
/* select AnimData block by itself */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ale->adt->flag |= ADT_UI_SELECTED;
}
@@ -1703,7 +1703,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
FCurve *fcu;
/* deselect all other channels */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
/* only select channels in group and group itself */
for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next)
@@ -1712,7 +1712,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
}
else {
/* select group by itself */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
agrp->flag |= AGRP_SELECTED;
}
@@ -1734,7 +1734,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
}
else {
/* select F-Curve by itself */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
fcu->flag |= FCURVE_SELECTED;
}
@@ -1756,7 +1756,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
}
else {
/* select ShapeKey by itself */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
kb->flag |= KEYBLOCK_SEL;
}
@@ -1914,6 +1914,7 @@ void ED_operatortypes_animchannels(void)
WM_operatortype_append(ANIM_OT_channels_visibility_set);
}
// TODO: check on a poll callback for this, to get hotkeys into menus
void ED_keymap_animchannels(wmKeyConfig *keyconf)
{
wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation Channels", 0, 0);
@@ -1949,8 +1950,8 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "ANIM_OT_channels_expand", PADPLUSKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "ANIM_OT_channels_collapse", PADMINUS, KM_PRESS, 0, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_expand", PADPLUSKEY, KM_PRESS, KM_CTRL, 0)->ptr, "all", 1);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_collapse", PADMINUS, KM_PRESS, KM_CTRL, 0)->ptr, "all", 1);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_expand", PADPLUSKEY, KM_PRESS, KM_CTRL, 0)->ptr, "all", 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_collapse", PADMINUS, KM_PRESS, KM_CTRL, 0)->ptr, "all", 0);
/* rearranging - actions only */
//WM_keymap_add_item(keymap, "ANIM_OT_channels_move_up", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0);

View File

@@ -904,7 +904,7 @@ static int animdata_filter_fcurves (ListBase *anim_data, bDopeSheet *ads, FCurve
return items;
}
static int animdata_filter_action (ListBase *anim_data, bDopeSheet *ads, bAction *act, int filter_mode, void *owner, short ownertype, ID *owner_id)
static int animdata_filter_action (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *act, int filter_mode, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale=NULL;
bActionGroup *agrp;
@@ -992,7 +992,7 @@ static int animdata_filter_action (ListBase *anim_data, bDopeSheet *ads, bAction
* - for normal filtering (i.e. for editing), we only need the NLA-tracks but they can be in 'normal' evaluation
* order, i.e. first to last. Otherwise, some tools may get screwed up.
*/
static int animdata_filter_nla (ListBase *anim_data, bDopeSheet *ads, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id)
static int animdata_filter_nla (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, AnimData *adt, int filter_mode, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale;
NlaTrack *nlt;
@@ -1062,7 +1062,7 @@ static int animdata_filter_nla (ListBase *anim_data, bDopeSheet *ads, AnimData *
}
/* Include ShapeKey Data for ShapeKey Editor */
static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_mode)
static int animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, Key *key, int filter_mode)
{
bAnimListElem *ale;
int items = 0;
@@ -1101,7 +1101,7 @@ static int animdata_filter_shapekey (ListBase *anim_data, Key *key, int filter_m
if (filter_mode & ANIMFILTER_ANIMDATA)
ANIMDATA_ADD_ANIMDATA(key)
else if (key->adt->action)
items= animdata_filter_action(anim_data, NULL, key->adt->action, filter_mode, NULL, ANIMTYPE_NONE, (ID *)key);
items= animdata_filter_action(ac, anim_data, NULL, key->adt->action, filter_mode, NULL, ANIMTYPE_NONE, (ID *)key);
}
}
@@ -1174,7 +1174,7 @@ static int animdata_filter_gpencil (ListBase *anim_data, bScreen *sc, int filter
#endif
static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
static int animdata_filter_dopesheet_mats (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
ListBase mats = {NULL, NULL};
LinkData *ld;
@@ -1242,9 +1242,9 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads,
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) {
ANIMDATA_FILTER_CASES(ma,
{ /* AnimData blocks - do nothing... */ },
items += animdata_filter_nla(anim_data, ads, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);,
items += animdata_filter_nla(ac, anim_data, ads, ma->adt, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);,
items += animdata_filter_fcurves(anim_data, ads, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);,
items += animdata_filter_action(anim_data, ads, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);)
items += animdata_filter_action(ac, anim_data, ads, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);)
}
}
}
@@ -1256,7 +1256,7 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads,
return items;
}
static int animdata_filter_dopesheet_particles (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
static int animdata_filter_dopesheet_particles (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
bAnimListElem *ale=NULL;
Object *ob= base->object;
@@ -1302,9 +1302,9 @@ static int animdata_filter_dopesheet_particles (ListBase *anim_data, bDopeSheet
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_PART_OBJD(psys->part) || (filter_mode & ANIMFILTER_CURVESONLY)) {
ANIMDATA_FILTER_CASES(psys->part,
{ /* AnimData blocks - do nothing... */ },
items += animdata_filter_nla(anim_data, ads, psys->part->adt, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);,
items += animdata_filter_nla(ac, anim_data, ads, psys->part->adt, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);,
items += animdata_filter_fcurves(anim_data, ads, psys->part->adt->drivers.first, NULL, psys->part, ANIMTYPE_DSPART, filter_mode, (ID *)psys->part);,
items += animdata_filter_action(anim_data, ads, psys->part->adt->action, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);)
items += animdata_filter_action(ac, anim_data, ads, psys->part->adt->action, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);)
}
}
}
@@ -1313,7 +1313,7 @@ static int animdata_filter_dopesheet_particles (ListBase *anim_data, bDopeSheet
return items;
}
static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
static int animdata_filter_dopesheet_obdata (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
bAnimListElem *ale=NULL;
Object *ob= base->object;
@@ -1394,16 +1394,16 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
/* filtering for channels - nla, drivers, keyframes */
ANIMDATA_FILTER_CASES(iat,
{ /* AnimData blocks - do nothing... */ },
items+= animdata_filter_nla(anim_data, ads, iat->adt, filter_mode, iat, type, (ID *)iat);,
items+= animdata_filter_nla(ac, anim_data, ads, iat->adt, filter_mode, iat, type, (ID *)iat);,
items+= animdata_filter_fcurves(anim_data, ads, adt->drivers.first, NULL, iat, type, filter_mode, (ID *)iat);,
items += animdata_filter_action(anim_data, ads, iat->adt->action, filter_mode, iat, type, (ID *)iat);)
items += animdata_filter_action(ac, anim_data, ads, iat->adt->action, filter_mode, iat, type, (ID *)iat);)
}
/* return the number of items added to the list */
return items;
}
static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
static int animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
{
bAnimListElem *ale=NULL;
AnimData *adt = NULL;
@@ -1439,7 +1439,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
{ /* AnimData blocks - do nothing... */ },
{ /* nla */
/* add NLA tracks */
items += animdata_filter_nla(anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
},
{ /* drivers */
/* include drivers-expand widget? */
@@ -1470,7 +1470,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* add F-Curve channels? */
if (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) {
// need to make the ownertype normal object here... (maybe type should be a separate one for clarity?)
items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
}
}
);
@@ -1497,7 +1497,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* add NLA tracks - only if expanded or so */
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY))
items += animdata_filter_nla(anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ob, ANIMTYPE_OBJECT, (ID *)ob);
},
{ /* drivers */
/* include shapekey-expand widget? */
@@ -1529,7 +1529,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* add channels */
if (!(filter_mode & ANIMFILTER_VISIBLE) || FILTER_SKE_OBJD(key) || (filter_mode & ANIMFILTER_CURVESONLY)) {
items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, key, ANIMTYPE_DSSKEY, (ID *)key);
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, key, ANIMTYPE_DSSKEY, (ID *)key);
}
}
);
@@ -1537,7 +1537,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
/* Materials? */
if ((ob->totcol) && !(ads->filterflag & ADS_FILTER_NOMAT))
items += animdata_filter_dopesheet_mats(anim_data, ads, base, filter_mode);
items += animdata_filter_dopesheet_mats(ac, anim_data, ads, base, filter_mode);
/* Object Data */
switch (ob->type) {
@@ -1623,17 +1623,17 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
break;
}
if (obdata_ok)
items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode);
items += animdata_filter_dopesheet_obdata(ac, anim_data, ads, base, filter_mode);
/* particles */
if (ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART))
items += animdata_filter_dopesheet_particles(anim_data, ads, base, filter_mode);
items += animdata_filter_dopesheet_particles(ac, anim_data, ads, base, filter_mode);
/* return the number of items added to the list */
return items;
}
static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
static int animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
{
World *wo= sce->world;
bNodeTree *ntree= sce->nodetree;
@@ -1664,7 +1664,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
{ /* AnimData blocks - do nothing... */ },
{ /* nla */
/* add NLA tracks */
items += animdata_filter_nla(anim_data, ads, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
},
{ /* drivers */
/* include drivers-expand widget? */
@@ -1693,7 +1693,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
/* add F-Curve channels? */
if (EXPANDED_ACTC(adt->action) || !(filter_mode & ANIMFILTER_CHANNELS)) {
items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, sce, ANIMTYPE_SCENE, (ID *)sce);
}
}
)
@@ -1707,7 +1707,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
{ /* AnimData blocks - do nothing... */ },
{ /* nla */
/* add NLA tracks */
items += animdata_filter_nla(anim_data, ads, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
},
{ /* drivers */
/* include world-expand widget? */
@@ -1737,7 +1737,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
/* add channels */
if (FILTER_WOR_SCED(wo) || (filter_mode & ANIMFILTER_CURVESONLY)) {
items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, wo, ANIMTYPE_DSWOR, (ID *)wo);
}
}
)
@@ -1750,7 +1750,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
{ /* AnimData blocks - do nothing... */ },
{ /* nla */
/* add NLA tracks */
items += animdata_filter_nla(anim_data, ads, adt, filter_mode, ntree, ANIMTYPE_DSNTREE, (ID *)ntree);
items += animdata_filter_nla(ac, anim_data, ads, adt, filter_mode, ntree, ANIMTYPE_DSNTREE, (ID *)ntree);
},
{ /* drivers */
/* include nodetree-expand widget? */
@@ -1780,7 +1780,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
/* add channels */
if (FILTER_NTREE_SCED(ntree) || (filter_mode & ANIMFILTER_CURVESONLY)) {
items += animdata_filter_action(anim_data, ads, adt->action, filter_mode, ntree, ANIMTYPE_DSNTREE, (ID *)ntree);
items += animdata_filter_action(ac, anim_data, ads, adt->action, filter_mode, ntree, ANIMTYPE_DSNTREE, (ID *)ntree);
}
}
)
@@ -1794,7 +1794,7 @@ static int animdata_filter_dopesheet_scene (ListBase *anim_data, bDopeSheet *ads
}
// TODO: implement pinning... (if and when pinning is done, what we need to do is to provide freeing mechanisms - to protect against data that was deleted)
static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDopeSheet *ads, int filter_mode)
static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, int filter_mode)
{
Scene *sce= (Scene *)ads->source;
Base *base;
@@ -1872,7 +1872,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDo
/* check if not all bad (i.e. so there is something to show) */
if ( !(!sceOk && !worOk && !nodeOk) ) {
/* add scene data to the list of filtered channels */
items += animdata_filter_dopesheet_scene(anim_data, ads, sce, filter_mode);
items += animdata_filter_dopesheet_scene(ac, anim_data, ads, sce, filter_mode);
}
}
@@ -2201,7 +2201,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDo
}
/* since we're still here, this object should be usable */
items += animdata_filter_dopesheet_ob(anim_data, ads, base, filter_mode);
items += animdata_filter_dopesheet_ob(ac, anim_data, ads, base, filter_mode);
}
}
@@ -2277,7 +2277,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
{
/* the check for the DopeSheet summary is included here since the summary works here too */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items += animdata_filter_action(anim_data, NULL, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact);
items += animdata_filter_action(ac, anim_data, NULL, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact);
}
break;
@@ -2285,7 +2285,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
{
/* the check for the DopeSheet summary is included here since the summary works here too */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items= animdata_filter_shapekey(anim_data, data, filter_mode);
items= animdata_filter_shapekey(ac, anim_data, data, filter_mode);
}
break;
@@ -2299,7 +2299,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
{
/* the DopeSheet editor is the primary place where the DopeSheet summaries are useful */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
items += animdata_filter_dopesheet(anim_data, ac, data, filter_mode);
items += animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
}
break;
@@ -2308,7 +2308,7 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
case ANIMCONT_NLA: /* NLA Editor */
{
/* all of these editors use the basic DopeSheet data for filtering options, but don't have all the same features */
items = animdata_filter_dopesheet(anim_data, ac, data, filter_mode);
items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
}
break;
}

View File

@@ -230,7 +230,9 @@ typedef enum eAnimFilter_Flags {
/* Actions (also used for Dopesheet) */
/* Action Channel Group */
#define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED)==0)
#define EXPANDED_AGRP(agrp) (agrp->flag & AGRP_EXPANDED)
#define EXPANDED_AGRP(agrp) \
( ( ((ac)->spacetype == SPACE_IPO) && (agrp->flag & AGRP_EXPANDED_G) ) || \
( ((ac)->spacetype != SPACE_IPO) && (agrp->flag & AGRP_EXPANDED) ) )
#define SEL_AGRP(agrp) ((agrp->flag & AGRP_SELECTED) || (agrp->flag & AGRP_ACTIVE))
/* F-Curve Channels */
#define EDITABLE_FCU(fcu) ((fcu->flag & FCURVE_PROTECTED)==0)
@@ -345,7 +347,7 @@ typedef struct bAnimChannelType {
/* check if the given setting is valid in the current context */
short (*has_setting)(bAnimContext *ac, bAnimListElem *ale, int setting);
/* get the flag used for this setting */
int (*setting_flag)(int setting, short *neg);
int (*setting_flag)(bAnimContext *ac, int setting, short *neg);
/* get the pointer to int/short where data is stored,
* with type being sizeof(ptr_data) which should be fine for runtime use...
* - assume that setting has been checked to be valid for current context
@@ -393,7 +395,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
/* Deselect all animation channels */
void ANIM_deselect_anim_channels(void *data, short datatype, short test, short sel);
void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, short test, short sel);
/* Set the 'active' channel of type channel_type, in the given action */
void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int filter, void *channel_data, short channel_type);

View File

@@ -633,7 +633,7 @@ static void actkeys_mselect_leftright (bAnimContext *ac, short leftright, short
select_mode= SELECT_ADD;
/* deselect all other channels and keyframes */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
deselect_action_keys(ac, 0, SELECT_SUBTRACT);
}
@@ -872,7 +872,7 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode,
/* highlight channel clicked on */
if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) {
/* deselect all other channels first */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
/* Highlight Action-Group or F-Curve? */
if (ale && ale->data) {
@@ -891,7 +891,7 @@ static void mouse_action_keys (bAnimContext *ac, int mval[2], short select_mode,
}
}
else if (ac->datatype == ANIMCONT_GPENCIL) {
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
/* Highlight gpencil layer */
//gpl->flag |= GP_LAYER_SELECT;

View File

@@ -706,7 +706,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
* doesn't depend on this
*/
if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0)
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
}
/* if points can be selected on this F-Curve */
@@ -804,7 +804,7 @@ static void graphkeys_mselect_leftright (bAnimContext *ac, short leftright, shor
* doesn't depend on this
*/
if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0)
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
}
/* set callbacks and editing data */
@@ -877,7 +877,7 @@ static void graphkeys_mselect_column (bAnimContext *ac, int mval[2], short selec
* doesn't depend on this
*/
if ((sipo->flag & SIPO_SELCUVERTSONLY) == 0)
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
}
/* initialise keyframe editing data */

View File

@@ -203,7 +203,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
}
else {
/* select AnimData block by itself */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ale->adt->flag |= ADT_UI_SELECTED;
}
@@ -262,7 +262,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
}
else {
/* select F-Curve by itself */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
nlt->flag |= NLATRACK_SELECTED;
}

View File

@@ -442,7 +442,7 @@ static void mouse_nla_strips (bContext *C, bAnimContext *ac, int mval[2], short
deselect_nla_strips(ac, 0, SELECT_SUBTRACT);
/* deselect all other channels first */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
/* Highlight NLA-Track */
if (ale->type == ANIMTYPE_NLATRACK) {
@@ -492,7 +492,7 @@ static void nlaedit_mselect_leftright (bContext *C, bAnimContext *ac, short left
select_mode= SELECT_ADD;
/* deselect all other channels and keyframes */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
deselect_nla_strips(ac, 0, SELECT_SUBTRACT);
}

View File

@@ -441,12 +441,14 @@ typedef enum eActionGroup_Flag {
AGRP_ACTIVE = (1<<1),
/* keyframes/channels belonging to it cannot be edited */
AGRP_PROTECTED = (1<<2),
/* for UI, sub-channels are shown */
/* for UI (DopeSheet), sub-channels are shown */
AGRP_EXPANDED = (1<<3),
/* sub-channels are not evaluated */
AGRP_MUTED = (1<<4),
/* sub-channels are not visible in Graph Editor */
AGRP_NOTVISIBLE = (1<<5),
/* for UI (Graph Editor), sub-channels are shown */
AGRP_EXPANDED_G = (1<<6),
AGRP_TEMP = (1<<30),
AGRP_MOVED = (1<<31)
@@ -509,10 +511,10 @@ typedef enum eDopeSheet_FilterFlag {
/* general filtering */
ADS_FILTER_ONLYSEL = (1<<0), /* only include channels relating to selected data */
/* temporary (runtime flags) */
ADS_FILTER_ONLYDRIVERS = (1<<1), /* for 'Drivers' editor - only include Driver data from AnimData */
/* assorted general settings */
ADS_FILTER_ONLYDRIVERS = (1<<1), /* for 'Drivers' editor - TEMPORARY - only include Driver data from AnimData */
ADS_FILTER_ONLYNLA = (1<<2), /* for 'NLA' editor - only include NLA data from AnimData */
ADS_FILTER_SELEDIT = (1<<3), /* for Graph Editor - used to indicate whether to include a filtering flag or not */
ADS_FILTER_SELEDIT = (1<<3), /* for Graph Editor - TEMPORARY - used to indicate whether to include a filtering flag or not */
ADS_FILTER_SUMMARY = (1<<4), /* for 'DopeSheet' Editor - include 'summary' line */
/* datatype-based filtering */