Fix for [#19852] Animation rendering not working in new scene
authorMatt Ebb <matt@mke3.net>
Tue, 10 Nov 2009 04:56:55 +0000 (04:56 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 10 Nov 2009 04:56:55 +0000 (04:56 +0000)
As part of this commit, I moved the scene frame_step to RenderData, where the other frame-related data is.

source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/screen/screen_ops.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c
source/creator/creator.c

index 4f72ca96f5f8d4fc66f1135d941fccb454e00cce..280311eee06795d6ffb8ad1bb9edf0c5d772e475 100644 (file)
@@ -323,6 +323,7 @@ Scene *add_scene(char *name)
        sce->r.cfra= 1;
        sce->r.sfra= 1;
        sce->r.efra= 250;
+       sce->r.frame_step= 1;
        sce->r.xsch= 1920;
        sce->r.ysch= 1080;
        sce->r.xasp= 1;
index d86d4c787bc5a6e313c017468ad4392f58bdc8c7..f6e216b36e8b216847d9101b7b33de469af1136d 100644 (file)
@@ -9157,15 +9157,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
 
-       if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 4)){
-               Scene *sce= main->scene.first;
-               while(sce) {
-                       if(sce->frame_step==0)
-                               sce->frame_step= 1;
-                       sce= sce->id.next;
-               }
-       }
-
        if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 5)) {
                Lamp *la= main->lamp.first;
                for(; la; la= la->id.next) {
@@ -10036,6 +10027,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
        /* put 2.50 compatibility code here until next subversion bump */
        {
+               {
+                       Scene *sce= main->scene.first;
+                       while(sce) {
+                               if(sce->r.frame_step==0)
+                                       sce->r.frame_step= 1;
+                               sce= sce->id.next;
+                       }
+               }
        }
 
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
index a1537b2ddf5739bd1b8ab2c1eace56cc793987ee..7e2c74bb8a95e976803ce88c673d717636983db4 100644 (file)
@@ -2672,7 +2672,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
        RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break);
        
        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);
        
@@ -2892,7 +2892,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);
 }
@@ -3245,7 +3245,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);
index bafe8cc316225ea3770f33c506ea8e7c69d51372..b041227110bd01316749370f2bf4a9b85c9283b4 100644 (file)
@@ -191,7 +191,8 @@ typedef struct RenderData {
        float edgeR, edgeG, edgeB;
        
        short fullscreen, xplay, yplay, freqplay;       /* standalone player */  //  XXX deprecated since 2.5
-       short depth, attrib, rt1, rt2;                  /* standalone player */  //  XXX deprecated since 2.5
+       short depth, attrib, rt2;                       /* standalone player */  //  XXX deprecated since 2.5
+       short frame_step;               /* frames to jump during render/playback */
 
        short stereomode;       /* standalone player stereo settings */  //  XXX deprecated since 2.5
        
@@ -738,10 +739,8 @@ typedef struct Scene {
        short recalc;                           /* recalc = counterpart of ob->recalc */
 
        short jumpframe;
+       int pad5;
 
-       /* frame step. */
-       int frame_step;
-       
        /* User-Defined KeyingSets */
        int active_keyingset;                   /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
        ListBase keyingsets;                    /* KeyingSets for the given frame */
index 5344d549565e2ee9a94436f747b76a9e2fac0720..1ea342de163a3e0f0dc5b68f25a4064edf01e404 100644 (file)
@@ -2287,7 +2287,7 @@ void RNA_def_scene(BlenderRNA *brna)
        
        prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME);
        RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE);
-       RNA_def_property_int_sdna(prop, NULL, "frame_step");
+       RNA_def_property_int_sdna(prop, NULL, "r.frame_step");
        RNA_def_property_range(prop, 0, MAXFRAME);
        RNA_def_property_ui_range(prop, 0, 100, 1, 0);
        RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame");
index 6f90c2ffe8437cb4f694a9d1ab8fae984a2b20ac..84e6eed9278810f902440129424e0443e9f9e569 100644 (file)
@@ -621,7 +621,7 @@ int main(int argc, char **argv)
 
                                                frame = MIN2(MAXFRAME, MAX2(MINAFRAME, frame));
                                                
-                                               RE_BlenderAnim(re, scene, frame, frame, scene->frame_step);
+                                               RE_BlenderAnim(re, scene, frame, frame, scene->r.frame_step);
                                        }
                                } else {
                                        printf("\nError: no blend loaded. cannot use '-f'.\n");
@@ -631,7 +631,7 @@ int main(int argc, char **argv)
                                if (CTX_data_scene(C)) {
                                        Scene *scene= CTX_data_scene(C);
                                        Render *re= RE_NewRender(scene->id.name);
-                                       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 {
                                        printf("\nError: no blend loaded. cannot use '-a'.\n");
                                }
@@ -671,7 +671,7 @@ int main(int argc, char **argv)
                                        Scene *scene= CTX_data_scene(C);
                                        if (a < argc) {
                                                int frame = atoi(argv[a]);
-                                               (scene->frame_step) = MIN2(MAXFRAME, MAX2(1, frame));
+                                               (scene->r.frame_step) = MIN2(MAXFRAME, MAX2(1, frame));
                                        }
                                } else {
                                        printf("\nError: no blend loaded. cannot use '-j'.\n");