Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 10 Dec 2018 01:45:38 +0000 (12:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 10 Dec 2018 01:45:38 +0000 (12:45 +1100)
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_graph/space_graph.c
source/blender/makesdna/DNA_space_types.h

index 6e0a14ff469a508cfec17088fd63d88c83e668ad..455472dfdfb6a344aea453550de8623d35d408f0 100644 (file)
@@ -7495,7 +7495,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map, Main
                                        /* 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;
index bfe52459a58a188b44eef74444561a0dac07a2a9..9a825715e18483f2417439681edaa47a375a5279 100644 (file)
@@ -622,7 +622,7 @@ static void graph_listener(wmWindow *UNUSED(win), 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);
                        }
@@ -785,6 +785,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);
 }
index 1e4e58b7c7e3e41c0e32a61020b28f75d0aeab70..fd977a7dafb9793064e7108fb85af9a8433600b1 100644 (file)
@@ -438,6 +438,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;
 
 /** \} */