diff options
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 9 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 40 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_event_system.h | 1 |
4 files changed, 29 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 4d3a0587a0b..07aa21f44ff 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -864,15 +864,6 @@ void BKE_sculpt_update_mesh_elements( Depsgraph *depsgraph, Scene *scene, Sculpt *sd, Object *ob, bool need_pmap, bool need_mask) { - if (depsgraph == NULL) { - /* Happens on file load. - * - * We do nothing in this case, it will be taken care about on depsgraph - * evaluation. - */ - return; - } - SculptSession *ss = ob->sculpt; Mesh *me = BKE_object_get_original_mesh(ob); MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 204bd62cfbe..19889f57261 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -296,11 +296,7 @@ static void wm_notifier_clear(wmNotifier *note) memset(((char *)note) + sizeof(Link), 0, sizeof(*note) - sizeof(Link)); } -/** - * Was part of #wm_event_do_notifiers, split out so it can be called once before entering the #WM_main loop. - * This ensures operators don't run before the UI and depsgraph are initialized. - */ -void wm_event_do_refresh_wm_and_depsgraph(bContext *C) +void wm_event_do_depsgraph(bContext *C) { wmWindowManager *wm = CTX_wm_manager(C); uint64_t win_combine_v3d_datamask = 0; @@ -315,18 +311,8 @@ void wm_event_do_refresh_wm_and_depsgraph(bContext *C) /* cached: editor refresh callbacks now, they get context */ for (wmWindow *win = wm->windows.first; win; win = win->next) { - const bScreen *screen = WM_window_get_active_screen(win); Scene *scene = WM_window_get_active_scene(win); ViewLayer *view_layer = WM_window_get_active_view_layer(win); - ScrArea *sa; - - CTX_wm_window_set(C, win); - for (sa = screen->areabase.first; sa; sa = sa->next) { - if (sa->do_refresh) { - CTX_wm_area_set(C, sa); - ED_area_do_refresh(C, sa); - } - } /* XXX make lock in future, or separated derivedmesh users in scene */ if (G.is_rendering == false) { @@ -350,6 +336,30 @@ void wm_event_do_refresh_wm_and_depsgraph(bContext *C) BKE_scene_graph_update_tagged(depsgraph, bmain); } } +} + +/** + * Was part of #wm_event_do_notifiers, split out so it can be called once before entering the #WM_main loop. + * This ensures operators don't run before the UI and depsgraph are initialized. + */ +void wm_event_do_refresh_wm_and_depsgraph(bContext *C) +{ + wmWindowManager *wm = CTX_wm_manager(C); + /* cached: editor refresh callbacks now, they get context */ + for (wmWindow *win = wm->windows.first; win; win = win->next) { + const bScreen *screen = WM_window_get_active_screen(win); + ScrArea *sa; + + CTX_wm_window_set(C, win); + for (sa = screen->areabase.first; sa; sa = sa->next) { + if (sa->do_refresh) { + CTX_wm_area_set(C, sa); + ED_area_do_refresh(C, sa); + } + } + } + + wm_event_do_depsgraph(C); CTX_wm_window_set(C, NULL); } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f00ec500bc0..240f1e48e4b 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -482,10 +482,11 @@ static void wm_file_read_post(bContext *C, const bool is_startup_file, const boo CTX_wm_window_set(C, wm->windows.first); - ED_editors_init(C); - Main *bmain = CTX_data_main(C); DEG_on_visible_update(bmain, true); + wm_event_do_depsgraph(C); + + ED_editors_init(C); #ifdef WITH_PYTHON if (is_startup_file) { diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index b9b41b0b685..d191fe4a9c2 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -97,6 +97,7 @@ void wm_event_do_handlers (bContext *C); void wm_event_add_ghostevent (wmWindowManager *wm, wmWindow *win, int type, int time, void *customdata); +void wm_event_do_depsgraph(bContext *C); void wm_event_do_refresh_wm_and_depsgraph(bContext *C); void wm_event_do_notifiers(bContext *C); |