merged changes to revision 24446
[blender.git] / source / blender / editors / screen / screen_ops.c
index f096db38f359c60fc3eb3188299958da64a60141..b7a8102c5e36dd4c5eeb8548f3e1737b398fcfd9 100644 (file)
@@ -2232,7 +2232,7 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
                ScreenAnimData *sad= wt->customdata;
                ScrArea *sa;
                int sync;
-
+               
                /* sync, don't sync, or follow scene setting */
                if(sad->flag & ANIMPLAY_FLAG_SYNC) sync= 1;
                else if(sad->flag & ANIMPLAY_FLAG_NO_SYNC) sync= 0;
@@ -2288,12 +2288,12 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
                                }
                        }
                }
-
+               
                /* since we follow drawflags, we can't send notifier but tag regions ourselves */
                ED_update_for_newframe(C, 1);
-
+               
                sound_update_playing(C);
-
+               
                for(sa= screen->areabase.first; sa; sa= sa->next) {
                        ARegion *ar;
                        for(ar= sa->regionbase.first; ar; ar= ar->next) {
@@ -2305,6 +2305,12 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
                        }
                }
                
+               /* recalculate the timestep for the timer now that we've finished calculating this,
+                * since the frames-per-second value may have been changed
+                */
+               // TODO: this may make evaluation a bit slower if the value doesn't change... any way to avoid this?
+               wt->timestep= (1.0/FPS);
+               
                //WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
                
                return OPERATOR_FINISHED;
@@ -2675,7 +2681,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
        FRS_set_context(C);
 
        if(RNA_boolean_get(op->ptr, "animation"))
-               RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->frame_step);
+               RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->r.frame_step);
        else
                RE_BlenderFrame(re, scene, scene->r.cfra);
        
@@ -2895,7 +2901,7 @@ static void render_startjob(void *rjv, short *stop, short *do_update)
        rj->do_update= do_update;
        
        if(rj->anim)
-               RE_BlenderAnim(rj->re, rj->scene, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->frame_step);
+               RE_BlenderAnim(rj->re, rj->scene, rj->scene->r.sfra, rj->scene->r.efra, rj->scene->r.frame_step);
        else
                RE_BlenderFrame(rj->re, rj->scene, rj->scene->r.cfra);
 }
@@ -3251,7 +3257,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even
        printf("\n");
        
        /* go to next frame */
-       oglrender->nfra += scene->frame_step;
+       oglrender->nfra += scene->r.frame_step;
        scene->r.cfra++;
 
        WM_event_add_notifier(C, NC_SCENE|ND_RENDER_RESULT, oglrender->scene);