diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-12-23 14:22:30 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-12-23 14:22:30 +0300 |
commit | da5025d46d6ba3a8cb723f63de20054de06f285a (patch) | |
tree | 6c2300d81d46ddda8b43beb851784ae31707c9a9 /source/blender/editors/space_action | |
parent | 21e2d9b85a9a1dbd0f0faa6aad61c77ac8c4f48f (diff) |
Bugfix #20463: In graph editor bone channels cannot be selected with 'A' or 'B' border select
This bug was caused by my recent commit to get bone select -> selection syncing working. The selection flushing was occurring too readily, blocking any selection tools from having any visible effect. Now this syncing is only triggered when appropriate notifiers+flags have been set.
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 1bc300395ca..6a53e565e75 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -45,6 +45,7 @@ #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_utildefines.h" #include "ED_space_api.h" #include "ED_screen.h" @@ -353,15 +354,22 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn) /* editor level listener */ static void action_listener(ScrArea *sa, wmNotifier *wmn) { + SpaceAction *saction= (SpaceAction *)sa->spacedata.first; + /* context changes */ switch (wmn->category) { case NC_ANIMATION: - ED_area_tag_redraw(sa); + /* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */ + if (ELEM(wmn->data, ND_KEYFRAME_SELECT, ND_ANIMCHAN_SELECT)) + ED_area_tag_redraw(sa); + else + ED_area_tag_refresh(sa); break; case NC_SCENE: switch (wmn->data) { - case ND_OB_ACTIVE: /* selection changed, so force refresh to flush */ + case ND_OB_ACTIVE: /* selection changed, so force refresh to flush (needs flag set to do syncing) */ case ND_OB_SELECT: + saction->flag |= SACTION_TEMP_NEEDCHANSYNC; ED_area_tag_refresh(sa); break; @@ -372,8 +380,9 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) break; case NC_OBJECT: switch (wmn->data) { - case ND_BONE_SELECT: /* selection changed, so force refresh to flush */ + case ND_BONE_SELECT: /* selection changed, so force refresh to flush (needs flag set to do syncing) */ case ND_BONE_ACTIVE: + saction->flag |= SACTION_TEMP_NEEDCHANSYNC; ED_area_tag_refresh(sa); break; @@ -391,11 +400,15 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) static void action_refresh(const bContext *C, ScrArea *sa) { - //SpaceAction *saction= CTX_wm_space_action(C); + SpaceAction *saction= CTX_wm_space_action(C); - /* update the state of the animchannels in response to changes from the data they represent */ - // TODO: check if we don't want this to happen - ANIM_sync_animchannels_to_data(C); + /* update the state of the animchannels in response to changes from the data they represent + * NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled + */ + if (saction->flag & SACTION_TEMP_NEEDCHANSYNC) { + ANIM_sync_animchannels_to_data(C); + saction->flag &= ~SACTION_TEMP_NEEDCHANSYNC; + } /* region updates? */ // XXX resizing y-extents of tot should go here? |