Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void wm_notifier_clear(wmNotifier *note) | static void wm_notifier_clear(wmNotifier *note) | ||||
| { | { | ||||
| /* NULL the entire notifier, only leaving (next, prev) members intact */ | /* NULL the entire notifier, only leaving (next, prev) members intact */ | ||||
| memset(((char *)note) + sizeof(Link), 0, sizeof(*note) - sizeof(Link)); | memset(((char *)note) + sizeof(Link), 0, sizeof(*note) - sizeof(Link)); | ||||
| } | } | ||||
| void wm_event_do_depsgraph(bContext *C) | void wm_event_do_depsgraph(bContext *C, bool is_after_open_file) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| /* The whole idea of locked interface is to prevent viewport and whatever | /* The whole idea of locked interface is to prevent viewport and whatever | ||||
| * thread to modify the same data. Because of this, we can not perform | * thread to modify the same data. Because of this, we can not perform | ||||
| * dependency graph update. | * dependency graph update. | ||||
| */ | */ | ||||
| if (wm->is_interface_locked) { | if (wm->is_interface_locked) { | ||||
| return; | return; | ||||
| Show All 17 Lines | for (wmWindow *win = wm->windows.first; win; win = win->next) { | ||||
| CustomData_MeshMasks_update(&scene->customdata_mask, &scene->customdata_mask_modal); | CustomData_MeshMasks_update(&scene->customdata_mask, &scene->customdata_mask_modal); | ||||
| /* TODO(sergey): For now all dependency graphs which are evaluated from | /* TODO(sergey): For now all dependency graphs which are evaluated from | ||||
| * workspace are considered active. This will work all fine with "locked" | * workspace are considered active. This will work all fine with "locked" | ||||
| * view layer and time across windows. This is to be granted separately, | * view layer and time across windows. This is to be granted separately, | ||||
| * and for until then we have to accept ambiguities when object is shared | * and for until then we have to accept ambiguities when object is shared | ||||
| * across visible view layers and has overrides on it. | * across visible view layers and has overrides on it. | ||||
| */ | */ | ||||
| Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); | Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); | ||||
| if (is_after_open_file) { | |||||
| DEG_graph_relations_update(depsgraph, bmain, scene, view_layer); | |||||
| DEG_graph_on_visible_update(bmain, depsgraph, true); | |||||
| } | |||||
| DEG_make_active(depsgraph); | DEG_make_active(depsgraph); | ||||
| BKE_scene_graph_update_tagged(depsgraph, bmain); | BKE_scene_graph_update_tagged(depsgraph, bmain); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Was part of #wm_event_do_notifiers, | * Was part of #wm_event_do_notifiers, | ||||
| * split out so it can be called once before entering the #WM_main loop. | * split out so it can be called once before entering the #WM_main loop. | ||||
| Show All 11 Lines | for (wmWindow *win = wm->windows.first; win; win = win->next) { | ||||
| for (sa = screen->areabase.first; sa; sa = sa->next) { | for (sa = screen->areabase.first; sa; sa = sa->next) { | ||||
| if (sa->do_refresh) { | if (sa->do_refresh) { | ||||
| CTX_wm_area_set(C, sa); | CTX_wm_area_set(C, sa); | ||||
| ED_area_do_refresh(C, sa); | ED_area_do_refresh(C, sa); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| wm_event_do_depsgraph(C); | wm_event_do_depsgraph(C, false); | ||||
| CTX_wm_window_set(C, NULL); | CTX_wm_window_set(C, NULL); | ||||
| } | } | ||||
| /* called in mainloop */ | /* called in mainloop */ | ||||
| void wm_event_do_notifiers(bContext *C) | void wm_event_do_notifiers(bContext *C) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| ▲ Show 20 Lines • Show All 4,859 Lines • Show Last 20 Lines | |||||