diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 13cb8eac653..464f2db30a2 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -117,7 +117,7 @@ void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, int mute void ED_refresh_viewport_fps(struct bContext *C); int ED_screen_animation_play(struct bContext *C, int sync, int mode); -bScreen *ED_screen_animation_playing(const struct bContext *C); +bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm); /* screen keymaps */ void ED_operatortypes_screen(void); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 9ed9c150dcb..b7bd027ba7f 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -506,7 +506,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) mainp = CTX_data_main(C); /* cancel animation playback */ - if (ED_screen_animation_playing(C)) + if (ED_screen_animation_playing(CTX_wm_manager(C))) ED_screen_animation_play(C, 0, 0); /* handle UI stuff */ diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index a2fc763163a..37ab87780b5 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1750,7 +1750,7 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync, wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); Scene *scene = CTX_data_scene(C); - bScreen *stopscreen = ED_screen_animation_playing(C); + bScreen *stopscreen = ED_screen_animation_playing(wm); if (stopscreen) { WM_event_remove_timer(wm, win, stopscreen->animtimer); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5280968c11f..5faa2deb266 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3039,9 +3039,8 @@ static void SCREEN_OT_animation_step(wmOperatorType *ot) /* ****************** anim player, starts or ends timer ***************** */ /* find window that owns the animation timer */ -bScreen *ED_screen_animation_playing(const bContext *C) +bScreen *ED_screen_animation_playing(const wmWindowManager *wm) { - wmWindowManager *wm = CTX_wm_manager(C); wmWindow *window; for (window = wm->windows.first; window; window = window->next) @@ -3057,7 +3056,7 @@ int ED_screen_animation_play(bContext *C, int sync, int mode) bScreen *screen = CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); - if (ED_screen_animation_playing(C)) { + if (ED_screen_animation_playing(CTX_wm_manager(C))) { /* stop playback now */ ED_screen_animation_timer(C, 0, 0, 0, 0); sound_stop_scene(scene); @@ -3114,7 +3113,7 @@ static void SCREEN_OT_animation_play(wmOperatorType *ot) static int screen_animation_cancel_exec(bContext *C, wmOperator *op) { - bScreen *screen = ED_screen_animation_playing(C); + bScreen *screen = ED_screen_animation_playing(CTX_wm_manager(C)); if (screen) { if (RNA_boolean_get(op->ptr, "restore_frame")) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 0019839aa4f..ee02f99d5b7 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2994,6 +2994,7 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const char *grid_unit) { + wmWindowManager *wm = CTX_wm_manager(C); Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -3025,7 +3026,7 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha return; } - if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_playing(C)) { + if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_playing(wm)) { draw_viewport_fps(scene, ar); } else if (U.uiflag & USER_SHOW_VIEWPORTNAME) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index dd8af64c15d..4c8b447cdfd 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1039,7 +1039,7 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) if (t->spacetype == SPACE_VIEW3D) { View3D *v3d = sa->spacedata.first; - bScreen *animscreen = ED_screen_animation_playing(C); + bScreen *animscreen = ED_screen_animation_playing(CTX_wm_manager(C)); t->view = v3d; t->animtimer= (animscreen)? animscreen->animtimer: NULL; diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index e442de6fc7c..71133634a96 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -94,8 +94,7 @@ static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static int rna_Screen_is_animation_playing_get(PointerRNA *ptr) { - bScreen *sc = (bScreen *)ptr->data; - return (sc->animtimer != NULL); + return (ED_screen_animation_playing(G.main->wm.first) != NULL); } static int rna_Screen_fullscreen_get(PointerRNA *ptr) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index a4127b2bdfd..fccd3b387f9 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1961,7 +1961,7 @@ void wm_event_do_handlers(bContext *C) CTX_wm_screen_set(C, win->screen); CTX_data_scene_set(C, scene); - if (((playing == 1) && (!ED_screen_animation_playing(C))) || ((playing == 0) && (ED_screen_animation_playing(C)))) { + if (((playing == 1) && (!ED_screen_animation_playing(wm))) || ((playing == 0) && (ED_screen_animation_playing(wm)))) { ED_screen_animation_play(C, -1, 1); } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 7cff0679452..86567873256 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -294,6 +294,7 @@ void view3d_apply_mat4(float mat[][4], float *ofs, float *quat, float *dist) {} int text_file_modified(struct Text *text) {return 0;} void ED_node_shader_default(struct Material *ma) {} void ED_screen_animation_timer_update(struct bContext *C, int redraws) {} +void ED_screen_animation_playing(struct wmWindowManager *wm) {} void ED_base_object_select(struct Base *base, short mode) {} int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md) {return 0;} int ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, char *name, int type) {return 0;}