diff options
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 2 |
4 files changed, 21 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index d554fbbabc1..1244b2900fd 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -458,8 +458,9 @@ float BKE_nla_tweakedit_remap (AnimData *adt, float cframe, short mode) /* sanity checks * - obviously we've got to have some starting data * - when not in tweakmode, the active Action does not have any scaling applied :) + * - when in tweakmode, if the no-mapping flag is set, do not map */ - if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0) + if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0 || (adt->flag & ADT_NLA_EDIT_NOMAP)) return cframe; /* if the active-strip info has been stored already, access this, otherwise look this up diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 0a2c32b5f52..5a891a541cb 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -264,14 +264,17 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh { AnimData *adt= BKE_animdata_from_id(ale->owner); /* this won't crash, right? */ - /* for now, only do something if user clicks on the 'push-down' button */ if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { - /* activate push-down function - only usable when not in TweakMode */ if (nlaedit_is_tweakmode_on(ac) == 0) { + /* 'push-down' action - only usable when not in TweakMode */ // TODO: make this use the operator instead of calling the function directly // however, calling the operator requires that we supply the args, and that works with proper buttons only BKE_nla_action_pushdown(adt); } + else { + /* when in tweakmode, this button becomes the toggle for mapped editing */ + adt->flag ^= ADT_NLA_EDIT_NOMAP; + } } } break; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6d4f65fe249..ab33434077e 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -886,7 +886,18 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) /* now draw some indicator icons */ if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) { - /* 'tweaking action' - not a button */ + /* toggle for tweaking with mapping/no-mapping (i.e. 'in place editing' toggle) */ + // for now, use pin icon to symbolise this + if (adt->flag & ADT_NLA_EDIT_NOMAP) + UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_PINNED); + else + UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_UNPINNED); + + fdrawline((float)(NLACHANNEL_NAMEWIDTH-offset), yminc, + (float)(NLACHANNEL_NAMEWIDTH-offset), ymaxc); + offset += 16;; + + /* 'tweaking action' indicator - not a button */ UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_EDIT); } else { diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index f9508efef31..110b33850f0 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -730,6 +730,8 @@ enum { ADT_NLA_EVAL_OFF = (1<<1), /* NLA is being 'tweaked' (i.e. in EditMode) */ ADT_NLA_EDIT_ON = (1<<2), + /* active Action for 'tweaking' does not have mapping applied for editing */ + ADT_NLA_EDIT_NOMAP = (1<<3), /* drivers expanded in UI */ ADT_DRIVERS_COLLAPSED = (1<<10), |