Action Editor - Tweaking code for refreshing.
authorJoshua Leung <aligorith@gmail.com>
Sun, 8 Feb 2009 11:06:26 +0000 (11:06 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 8 Feb 2009 11:06:26 +0000 (11:06 +0000)
Although there is currently code in place to listen to notifiers + tag updates for regions, these don't actually result in any changes yet. Everything still relies on 'manual' redraw tags for the entire area to have refreshes.

source/blender/editors/animation/anim_deps.c
source/blender/editors/space_action/space_action.c

index ab3e40ef9ca1450521d75010e31302281357fe1e..1ff2169bf61687d5cdb93d0b3c41112a48b0db7b 100644 (file)
@@ -95,10 +95,10 @@ void ANIM_animdata_send_notifiers (bContext *C, bAnimContext *ac, short data_cha
                                case ANIM_CHANGED_KEYFRAMES_VALUES:
                                        /* keyframe values changed, so transform may have changed */
                                        // XXX what about other cases? maybe we need general ND_KEYFRAMES or ND_ANIMATION?
-                                       WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
+                                       WM_event_add_notifier(C, NC_OBJECT|ND_KEYS|ND_TRANSFORM, NULL);
                                        break;
-                               case ANIM_CHANGED_KEYFRAMES_SELECT:     // XXX what to do here?
-                                       WM_event_add_notifier(C, NC_SCENE, NULL);
+                               case ANIM_CHANGED_KEYFRAMES_SELECT:
+                                       WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL);
                                        break;
                                case ANIM_CHANGED_CHANNELS:
                                        // XXX err... check available datatypes in dopesheet first?
@@ -117,8 +117,24 @@ void ANIM_animdata_send_notifiers (bContext *C, bAnimContext *ac, short data_cha
                {
                        Object *obact= CTX_data_active_object(C);
                        
-                       // only update active object for now... more detail to come!
-                       WM_event_add_notifier(C, NC_OBJECT, obact);
+                       switch (data_changed) {
+                               case ANIM_CHANGED_KEYFRAMES_VALUES:
+                                       /* keyframe values changed, so transform may have changed */
+                                       // XXX what about other cases? maybe we need general ND_KEYFRAMES or ND_ANIMATION?
+                                       WM_event_add_notifier(C, NC_OBJECT|ND_KEYS|ND_TRANSFORM, obact);
+                                       break;
+                               case ANIM_CHANGED_KEYFRAMES_SELECT:
+                                       WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, obact);
+                                       break;
+                               case ANIM_CHANGED_CHANNELS:
+                                       // XXX err... check available datatypes in dopesheet first?
+                                       // FIXME: this currently doesn't work (to update own view)
+                                       WM_event_add_notifier(C, NC_OBJECT|ND_BONE_ACTIVE|ND_BONE_SELECT, obact);
+                                       break;
+                       }
+                       
+                       // XXX for now, at least update own editor!
+                       ED_area_tag_redraw(CTX_wm_area(C));
                }
                        break;
                        
index 37c787877f2fe124e280aee8820908b78aba7502..0678acc6769f5d686144febfb034ffbbf49cb436 100644 (file)
@@ -298,7 +298,6 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
                        switch(wmn->data) {
                                case ND_BONE_ACTIVE:
                                case ND_BONE_SELECT:
-                               case ND_KEYS:
                                        ED_region_tag_redraw(ar);
                                        break;
                        }
@@ -327,6 +326,7 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
                                case ND_BONE_ACTIVE:
                                case ND_BONE_SELECT:
                                case ND_KEYS:
+                               case ND_TRANSFORM:
                                        ED_region_tag_redraw(ar);
                                        break;
                        }