Fix for last commit, forgot to update Screen.is_animation_playing python property.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 25 May 2012 12:56:29 +0000 (12:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 25 May 2012 12:56:29 +0000 (12:56 +0000)
source/blender/editors/include/ED_screen.h
source/blender/editors/render/render_internal.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/transform/transform_generics.c
source/blender/makesrna/intern/rna_screen.c
source/blender/windowmanager/intern/wm_event_system.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 13cb8ea..464f2db 100644 (file)
@@ -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);
index 9ed9c15..b7bd027 100644 (file)
@@ -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 */
index a2fc763..37ab877 100644 (file)
@@ -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);
index 5280968..5faa2de 100644 (file)
@@ -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")) {
index 0019839..ee02f99 100644 (file)
@@ -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) {
index dd8af64..4c8b447 100644 (file)
@@ -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;
index e442de6..7113363 100644 (file)
@@ -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)
index a4127b2..fccd3b3 100644 (file)
@@ -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);
                                        }
                                        
index 7cff067..8656787 100644 (file)
@@ -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;}