Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_event_system.c
| Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | for (note = wm->queue.first; note; note = next) { | ||||
| (note->window == NULL && (note->reference == NULL || note->reference == scene))) | (note->window == NULL && (note->reference == NULL || note->reference == scene))) | ||||
| { | { | ||||
| if (note->category == NC_SCENE) { | if (note->category == NC_SCENE) { | ||||
| if (note->data == ND_FRAME) | if (note->data == ND_FRAME) | ||||
| do_anim = true; | do_anim = true; | ||||
| } | } | ||||
| } | } | ||||
| if (ELEM(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_WM)) { | if (ELEM(note->category, NC_SCENE, NC_OBJECT, NC_GEOM, NC_WM)) { | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| ED_info_stats_clear(scene_layer); | ED_info_stats_clear(view_layer); | ||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL); | WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO, NULL); | ||||
| } | } | ||||
| } | } | ||||
| if (do_anim) { | if (do_anim) { | ||||
| /* XXX, quick frame changes can cause a crash if framechange and rendering | /* XXX, quick frame changes can cause a crash if framechange and rendering | ||||
| * collide (happens on slow scenes), BKE_scene_graph_update_for_newframe can be called | * collide (happens on slow scenes), BKE_scene_graph_update_for_newframe can be called | ||||
| * twice which can depgraph update the same object at once */ | * twice which can depgraph update the same object at once */ | ||||
| if (G.is_rendering == false) { | if (G.is_rendering == false) { | ||||
| /* depsgraph gets called, might send more notifiers */ | /* depsgraph gets called, might send more notifiers */ | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_depsgraph(C); | ||||
| ED_update_for_newframe(CTX_data_main(C), scene, scene_layer, depsgraph); | ED_update_for_newframe(CTX_data_main(C), scene, view_layer, depsgraph); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* the notifiers are sent without context, to keep it clean */ | /* the notifiers are sent without context, to keep it clean */ | ||||
| while ((note = BLI_pophead(&wm->queue))) { | while ((note = BLI_pophead(&wm->queue))) { | ||||
| for (win = wm->windows.first; win; win = win->next) { | for (win = wm->windows.first; win; win = win->next) { | ||||
| Scene *scene = WM_window_get_active_scene(win); | Scene *scene = WM_window_get_active_scene(win); | ||||
| ▲ Show 20 Lines • Show All 2,203 Lines • ▼ Show 20 Lines | else { | ||||
| } | } | ||||
| if (is_playing_sound == 0) { | if (is_playing_sound == 0) { | ||||
| const float time = BKE_sound_sync_scene(scene); | const float time = BKE_sound_sync_scene(scene); | ||||
| if (isfinite(time)) { | if (isfinite(time)) { | ||||
| int ncfra = time * (float)FPS + 0.5f; | int ncfra = time * (float)FPS + 0.5f; | ||||
| if (ncfra != scene->r.cfra) { | if (ncfra != scene->r.cfra) { | ||||
| scene->r.cfra = ncfra; | scene->r.cfra = ncfra; | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_depsgraph(C); | ||||
| ED_update_for_newframe(CTX_data_main(C), scene, scene_layer, depsgraph); | ED_update_for_newframe(CTX_data_main(C), scene, view_layer, depsgraph); | ||||
| WM_event_add_notifier(C, NC_WINDOW, NULL); | WM_event_add_notifier(C, NC_WINDOW, NULL); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| CTX_data_scene_set(C, NULL); | CTX_data_scene_set(C, NULL); | ||||
| CTX_wm_screen_set(C, NULL); | CTX_wm_screen_set(C, NULL); | ||||
| CTX_wm_window_set(C, NULL); | CTX_wm_window_set(C, NULL); | ||||
| ▲ Show 20 Lines • Show All 1,341 Lines • Show Last 20 Lines | |||||