From 5f92078d53884c6b2715e64482702108316607ad Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 14 Mar 2013 05:44:56 +0000 Subject: More AnimData selection fixes * Not all supported datatypes would show up in the NLA Properties Region when selected * Clicking on the name part of the "Active Action" tracks now selects the AnimData block that action is attached to --- source/blender/editors/space_nla/nla_buttons.c | 4 +++- source/blender/editors/space_nla/nla_channels.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_nla') diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index eb7de072043..1e0d8437150 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -131,7 +131,6 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA case ANIMTYPE_SCENE: /* Top-Level Widgets doubling up as datablocks */ case ANIMTYPE_OBJECT: - case ANIMTYPE_FILLACTD: /* Action Expander */ case ANIMTYPE_DSMAT: /* Datablock AnimData Expanders */ case ANIMTYPE_DSLAM: case ANIMTYPE_DSCAM: @@ -142,6 +141,9 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA case ANIMTYPE_DSPART: case ANIMTYPE_DSMBALL: case ANIMTYPE_DSARM: + case ANIMTYPE_DSMESH: + case ANIMTYPE_DSTEX: + case ANIMTYPE_DSLAT: case ANIMTYPE_DSSPK: { /* for these channels, we only do AnimData */ diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 07e6d9bca11..ba1a3accf93 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -265,6 +265,7 @@ static int mouse_nla_channels(bAnimContext *ac, float x, int channel_index, shor { AnimData *adt = BKE_animdata_from_id(ale->id); + /* button area... */ if (x >= (v2d->cur.xmax - NLACHANNEL_BUTTON_WIDTH)) { if (nlaedit_is_tweakmode_on(ac) == 0) { /* 'push-down' action - only usable when not in TweakMode */ @@ -280,6 +281,30 @@ static int mouse_nla_channels(bAnimContext *ac, float x, int channel_index, shor /* changes to NLA-Action occurred */ notifierFlags |= ND_NLA_ACTCHANGE; } + /* OR rest of name... */ + else { + /* NOTE: rest of NLA-Action name doubles for operating on the AnimData block + * - this is useful when there's no clear divider, and makes more sense in + * the case of users trying to use this to change actions + */ + + /* select/deselect */ + if (selectmode == SELECT_INVERT) { + /* inverse selection status of this AnimData block only */ + adt->flag ^= ADT_UI_SELECTED; + } + else { + /* select AnimData block by itself */ + ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + adt->flag |= ADT_UI_SELECTED; + } + + /* set active? */ + if (adt->flag & ADT_UI_SELECTED) + adt->flag |= ADT_UI_ACTIVE; + + notifierFlags |= (ND_ANIMCHAN | NA_SELECTED); + } } break; -- cgit v1.2.3