[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47719] trunk/blender/source/blender: Bugfix [#28962] Changing actions via undo/ delete all keyframes lacks UI refresh

Joshua Leung aligorith at gmail.com
Mon Jun 11 06:13:46 CEST 2012


Revision: 47719
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47719
Author:   aligorith
Date:     2012-06-11 04:13:39 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
Bugfix [#28962] Changing actions via undo/delete all keyframes lacks UI refresh

Slightly hacky fix to get updates working for Action Editor header when there
are changes of the active action (via undo and/or deleting all keyframes at
once). Since the action referenced by the editor only gets updated when anim
channel filtering (e.g. as a result of the channel syncing operation) is
invoked. Added comments noting where these updates actually occur

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/space_action/space_action.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-06-11 03:06:31 UTC (rev 47718)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-06-11 04:13:39 UTC (rev 47719)
@@ -5551,6 +5551,12 @@
 					
 					if (saction->ads.filter_grp)
 						saction->ads.filter_grp= restore_pointer_by_name(newmain, (ID *)saction->ads.filter_grp, 0);
+						
+					
+					/* force recalc of list of channels, potentially updating the active action 
+					 * while we're at it (as it can only be updated that way) [#28962] 
+					 */
+					saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
 				}
 				else if (sl->spacetype == SPACE_IMAGE) {
 					SpaceImage *sima = (SpaceImage *)sl;

Modified: trunk/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/space_action.c	2012-06-11 03:06:31 UTC (rev 47718)
+++ trunk/blender/source/blender/editors/space_action/space_action.c	2012-06-11 04:13:39 UTC (rev 47719)
@@ -435,6 +435,12 @@
 					break;
 			}			
 			break;
+		case NC_WINDOW:
+			if (saction->flag & SACTION_TEMP_NEEDCHANSYNC) {
+				/* force redraw/refresh after undo/redo - [#28962] */
+				ED_area_tag_refresh(sa);
+			}
+			break;
 	}
 }
 
@@ -464,9 +470,21 @@
 	 * 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) {
+		ARegion *ar;
+		
+		/* Perform syncing of channel state incl. selection
+		 * Active action setting also occurs here (as part of anim channel filtering in anim_filter.c)
+		 */
 		ANIM_sync_animchannels_to_data(C);
 		saction->flag &= ~SACTION_TEMP_NEEDCHANSYNC;
+		
+		/* Tag everything for redraw
+		 * - Regions (such as header) need to be manually tagged for redraw too
+		 *   or else they don't update [#28962]
+		 */
 		ED_area_tag_redraw(sa);
+		for (ar = sa->regionbase.first; ar; ar = ar->next)
+			ED_region_tag_redraw(ar);
 	}
 	
 	/* region updates? */




More information about the Bf-blender-cvs mailing list