[Bf-blender-cvs] [642c315bae1] master: Fix T53544: Undo in pose mode selects all fcurves

Campbell Barton noreply at git.blender.org
Mon Dec 10 02:31:49 CET 2018


Commit: 642c315bae13ccb418ec767e6f29ca4e450dde5d
Author: Campbell Barton
Date:   Mon Dec 10 12:30:41 2018 +1100
Branches: master
https://developer.blender.org/rB642c315bae13ccb418ec767e6f29ca4e450dde5d

Fix T53544: Undo in pose mode selects all fcurves

===================================================================

M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/space_graph/space_graph.c
M	source/blender/makesdna/DNA_space_types.h

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ddbe855d03e..8d89620cdec 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6859,7 +6859,7 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
 					/* force recalc of list of channels (i.e. includes calculating F-Curve colors)
 					 * thus preventing the "black curves" problem post-undo
 					 */
-					sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC;
+					sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR;
 				}
 				else if (sl->spacetype == SPACE_BUTS) {
 					SpaceButs *sbuts = (SpaceButs *)sl;
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index fead6efa2b5..3b476ff3645 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -513,7 +513,7 @@ static void graph_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 				ED_area_tag_redraw(sa);
 			break;
 		case NC_WINDOW:
-			if (sipo->runtime.flag & SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC) {
+			if (sipo->runtime.flag & (SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC | SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR)) {
 				/* force redraw/refresh after undo/redo - prevents "black curve" problem */
 				ED_area_tag_refresh(sa);
 			}
@@ -676,6 +676,15 @@ static void graph_refresh(const bContext *C, ScrArea *sa)
 		ED_area_tag_redraw(sa);
 	}
 
+	/* We could check 'SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR', but color is recalculated anyway. */
+	if (sipo->runtime.flag & SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR) {
+		sipo->runtime.flag &= ~SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR;
+#if 0	/* Done below. */
+		graph_refresh_fcurve_colors(C);
+#endif
+		ED_area_tag_redraw(sa);
+	}
+
 	/* init/adjust F-Curve colors */
 	graph_refresh_fcurve_colors(C);
 }
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 029f7a6fca9..d85b9626735 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -407,6 +407,8 @@ typedef enum eGraphEdit_Mode {
 typedef enum eGraphEdit_Runtime_Flag {
 	/** Temporary flag to force channel selections to be synced with main. */
 	SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC        = (1 << 0),
+	/** Temporary flag to force fcurves to recalculate colors. */
+	SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR  = (1 << 1),
 } eGraphEdit_Runtime_Flag;
 
 /** \} */



More information about the Bf-blender-cvs mailing list