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.
This commit is contained in:
Brecht Van Lommel 2010-01-20 15:44:37 +00:00
parent 939c3ba9cb
commit 0c3e5dec93
2 changed files with 20 additions and 1 deletions

@ -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

@ -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);