diff options
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 19 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels.c | 14 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 39 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 11 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 8 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 3 |
7 files changed, 77 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 4c0c30fe5c1..9befe9dc9cb 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -492,11 +492,14 @@ static void animsys_evaluate_fcurves (PointerRNA *ptr, ListBase *list, AnimMappe /* calculate then execute each curve */ for (fcu= list->first; fcu; fcu= fcu->next) { - /* check if this curve should be skipped */ - if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) - { - calculate_fcurve(fcu, ctime); - animsys_execute_fcurve(ptr, remap, fcu); + /* check if this F-Curve doesn't belong to a muted group */ + if ((fcu->grp == NULL) || (fcu->grp->flag & AGRP_MUTED)==0) { + /* check if this curve should be skipped */ + if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) + { + calculate_fcurve(fcu, ctime); + animsys_execute_fcurve(ptr, remap, fcu); + } } } } @@ -551,6 +554,10 @@ void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup if ELEM(NULL, act, agrp) return; if ((remap) && (remap->target != act)) remap= NULL; + /* if group is muted, don't evaluated any of the F-Curve */ + if (agrp->flag & AGRP_MUTED) + return; + /* calculate then execute each curve */ for (fcu= agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu= fcu->next) { @@ -884,6 +891,8 @@ static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, N /* check if this curve should be skipped */ if (fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) continue; + if ((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) + continue; /* evaluate the F-Curve's value for the time given in the strip * NOTE: we use the modified time here, since strip's F-Curve Modifiers are applied on top of this diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 4ac1648361e..5e9abd42aeb 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -928,6 +928,12 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, case ACHANNEL_SETTING_EXPAND: ACHANNEL_SET_FLAG(agrp, mode, AGRP_EXPANDED); break; + case ACHANNEL_SETTING_MUTE: + ACHANNEL_SET_FLAG(agrp, mode, AGRP_MUTED); + break; + case ACHANNEL_SETTING_VISIBLE: + ACHANNEL_SET_FLAG_NEG(agrp, mode, AGRP_NOTVISIBLE); + break; } } break; @@ -1491,10 +1497,18 @@ static void mouse_anim_channels (bAnimContext *ac, float x, int channel_index, s /* toggle expand */ agrp->flag ^= AGRP_EXPANDED; } + else if ((x < (offset+32)) && (ac->spacetype==SPACE_IPO)) { + /* toggle visibility (of grouped F-Curves in Graph editor) */ + agrp->flag ^= AGRP_NOTVISIBLE; + } else if (x >= (ACHANNEL_NAMEWIDTH-ACHANNEL_BUTTON_WIDTH)) { /* toggle protection/locking */ agrp->flag ^= AGRP_PROTECTED; } + else if (x >= (ACHANNEL_NAMEWIDTH-2*ACHANNEL_BUTTON_WIDTH)) { + /* toggle mute */ + agrp->flag ^= AGRP_MUTED; + } else { /* select/deselect group */ if (selectmode == SELECT_INVERT) { diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index f9c1b1bb42f..42943475a57 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -682,25 +682,30 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter * cases when we should include F-Curves inside group: * - we don't care about visibility * - group is expanded - * - we're interested in keyframes, but not if they appear in selected channels + * - we just need the F-Curves present */ - // XXX what was the selection check here for again? - if ( (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) || - ( /*ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) &&*/ (filter_mode & ANIMFILTER_CURVESONLY) ) ) + if ( (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) || (filter_mode & ANIMFILTER_CURVESONLY) ) { - if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { - // XXX the 'owner' info here needs review... - items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id); - - /* remove group from filtered list if last element is group - * (i.e. only if group had channels, which were all hidden) - */ - // XXX this is really hacky... it should be fixed in a much more elegant way! - if ( (ale) && (anim_data->last == ale) && - (ale->data == agrp) && (agrp->channels.first) ) - { - BLI_freelinkN(anim_data, ale); - items--; + /* for the Graph Editor, curves may be set to not be visible in the view to lessen clutter, + * but to do this, we need to check that the group doesn't have it's not-visible flag set preventing + * all its sub-curves to be shown + */ + if ( !(filter_mode & ANIMFILTER_CURVEVISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) ) + { + if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { + // XXX the 'owner' info here needs review... + items += animdata_filter_fcurves(anim_data, agrp->channels.first, agrp, owner, ownertype, filter_mode, owner_id); + + /* remove group from filtered list if last element is group + * (i.e. only if group had channels, which were all hidden) + */ + // XXX this is really hacky... it should be fixed in a much more elegant way! + if ( (ale) && (anim_data->last == ale) && + (ale->data == agrp) && (agrp->channels.first) ) + { + BLI_freelinkN(anim_data, ale); + items--; + } } } } diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index f3a0dda4ce7..910b9733bc8 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -645,6 +645,11 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) expand = ICON_TRIA_RIGHT; } + if (agrp->flag & AGRP_MUTED) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + if (EDITABLE_AGRP(agrp)) protect = ICON_UNLOCKED; else diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 0d7dafe2938..f8f613223db 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1166,6 +1166,17 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) expand = ICON_TRIA_RIGHT; } + /* for now, 'special' (i.e. in front of name) is used to show visibility status */ + if (agrp->flag & AGRP_NOTVISIBLE) + special= ICON_CHECKBOX_DEHLT; + else + special= ICON_CHECKBOX_HLT; + + if (agrp->flag & AGRP_MUTED) + mute = ICON_MUTE_IPO_ON; + else + mute = ICON_MUTE_IPO_OFF; + if (EDITABLE_AGRP(agrp)) protect = ICON_UNLOCKED; else diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index a566f733978..4eddebc5b67 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -225,10 +225,18 @@ typedef struct bActionGroup { /* Action Group flags */ typedef enum eActionGroup_Flag { + /* group is selected */ AGRP_SELECTED = (1<<0), + /* group is 'active' / last selected one */ AGRP_ACTIVE = (1<<1), + /* keyframes/channels belonging to it cannot be edited */ AGRP_PROTECTED = (1<<2), + /* for UI, 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), AGRP_TEMP = (1<<30), AGRP_MOVED = (1<<31) diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 110b33850f0..a90fad983c4 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -737,6 +737,9 @@ enum { ADT_DRIVERS_COLLAPSED = (1<<10), /* don't execute drivers */ ADT_DRIVERS_DISABLED = (1<<11), + + /* F-Curves from this AnimData block are not visible in the Graph Editor */ + ADT_CURVES_NOT_VISIBLE = (1<<16), } eAnimData_Flag; /* Animation Data recalculation settings (to be set by depsgraph) */ |