From 0c3e5dec93759f3d557e6c1746e80c2cf5b74f06 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 20 Jan 2010 15:44:37 +0000 Subject: [PATCH] Fix action editor now updating when changing the active object. I can't work out of this was an intentional change or not, but working with two objects became quite tedious because action would have to be changed manually each time. Also fixed missing redraw of header. --- .../blender/editors/animation/anim_filter.c | 2 +- .../editors/space_action/space_action.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 44199832156..e6d9bcf2d64 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -159,7 +159,7 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction) switch (saction->mode) { case SACTCONT_ACTION: /* 'Action Editor' */ /* if not pinned, sync with active object */ - if (/*saction->pin == 0*/0) { + if (/*saction->pin == 0*/1) { if (ac->obact && ac->obact->adt) saction->action = ac->obact->adt->action; else diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 57a39b3225e..66e6e770ca4 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -398,6 +398,24 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) } } +static void action_header_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + case NC_SCENE: + switch(wmn->data) { + case ND_OB_ACTIVE: + ED_region_tag_redraw(ar); + break; + } + break; + case NC_ID: + if(wmn->action == NA_RENAME) + ED_region_tag_redraw(ar); + break; + } +} + static void action_refresh(const bContext *C, ScrArea *sa) { SpaceAction *saction= CTX_wm_space_action(C); @@ -450,6 +468,7 @@ void ED_spacetype_action(void) art->init= action_header_area_init; art->draw= action_header_area_draw; + art->listener= action_header_area_listener; BLI_addhead(&st->regiontypes, art);