More work on render stuff!
authorTon Roosendaal <ton@blender.org>
Sat, 4 Feb 2006 13:28:50 +0000 (13:28 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 4 Feb 2006 13:28:50 +0000 (13:28 +0000)
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.

The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.

Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.

- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".

- Bug fixes

Added redraw event for Image window, when using compositor render.

Text objects were not rendered using background render (probably a bug
since depsgraph was added)

Dropdown buttons in Node editor were not refreshed after usage

Sometimes render window did not open, this due to wrong check for 'esc'.

Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.

15 files changed:
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/node_composite.c
source/blender/blenkernel/intern/scene.c
source/blender/python/api2_2x/Scene.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/src/drawnode.c
source/blender/src/drawscene.c
source/blender/src/editnode.c
source/blender/src/interface.c
source/blender/src/renderwin.c
source/blender/src/sequence.c
source/blender/src/space.c

index 353389fde38c81ea0d5a06b759c032a5aeed44c4..71b5c126ec334e6076e0987bc65402cf7ff41431 100644 (file)
@@ -223,7 +223,6 @@ extern bNodeType *node_all_composit[];
 
 /* API */
 struct CompBuf;
-int ntreeCompositNeedsRender(struct bNodeTree *ntree);
 void ntreeCompositTagRender(struct bNodeTree *ntree);
 void ntreeCompositTagAnimated(struct bNodeTree *ntree);
 
index 9a4a8f62600d1fe025d6a9714a7d239522a1580a..51701c19ca05f9c510004c4536433aaff39a1529 100644 (file)
@@ -1624,7 +1624,12 @@ static void dag_object_time_update_flags(Object *ob)
                                                ob->shapeflag &= ~OB_SHAPE_TEMPLOCK;
                                        }
                                }
-                                       break;
+                               break;
+                       case OB_FONT:
+                               cu= ob->data;
+                               if(cu->nurb.first==NULL && cu->str && cu->vfont)
+                                       ob->recalc |= OB_RECALC_DATA;
+                               break;
                        case OB_LATTICE:
                                lt= ob->data;
                                if(lt->key) {
index 60cf84c7f929470fd7b4cf877ada23f397c84325..8a04f37bb3a6f0bd298b2082fec5c40fb2c218ba 100644 (file)
@@ -832,8 +832,13 @@ static CompBuf *compbuf_from_pass(RenderLayer *rl, int rectx, int recty, int pas
 
 static void node_composit_exec_rresult(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
 {
-       RenderResult *rr= RE_GetResult(RE_GetRender("Render"));
+       RenderResult *rr;
        
+       if(node->id && node->id!=&G.scene->id)
+               rr= RE_GetResult(RE_GetRender(node->id->name+2));
+       else
+               rr= RE_GetResult(RE_GetRender("Render"));
+               
        if(rr) {
                RenderLayer *rl= BLI_findlink(&rr->layers, node->custom1);
                if(rl) {
@@ -1406,18 +1411,31 @@ static bNodeSocketType cmp_node_alphaover_out[]= {
        {       -1, 0, ""       }
 };
 
-static void do_alphaover(bNode *node, float *out, float *src, float *dest)
+static void do_alphaover(bNode *node, float *out, float *src, float *over)
 {
-       float mul= 1.0f - dest[3];
        
-       if(mul<=0.0f) {
-               QUATCOPY(out, dest);
+       if(over[3]<=0.0f) {
+               QUATCOPY(out, src);
+       }
+       else if(over[3]>=1.0f) {
+               QUATCOPY(out, over);
        }
        else {
-               out[0]= (mul*src[0]) + dest[0];
-               out[1]= (mul*src[1]) + dest[1];
-               out[2]= (mul*src[2]) + dest[2];
-               out[3]= (mul*src[3]) + dest[3];
+               float mul= 1.0f - over[3];
+               
+               /* handle case where backdrop has no alpha, but still color */
+               if(src[0]==0.0f) {
+                       out[0]= over[0];
+                       out[1]= (mul*src[1]) + over[1];
+                       out[2]= (mul*src[2]) + over[2];
+                       out[3]= (mul*src[3]) + over[3];
+               }
+               else {
+                       out[0]= (mul*src[0]) + over[0];
+                       out[1]= (mul*src[1]) + over[1];
+                       out[2]= (mul*src[2]) + over[2];
+                       out[3]= (mul*src[3]) + over[3];
+               }
        }       
 }
 
@@ -2177,19 +2195,6 @@ bNodeType *node_all_composit[]= {
 
 /* ******************* parse ************ */
 
-/* helper call to detect if theres a render-result node */
-int ntreeCompositNeedsRender(bNodeTree *ntree)
-{
-       bNode *node;
-       
-       if(ntree==NULL) return 1;
-       
-       for(node= ntree->nodes.first; node; node= node->next) {
-               if(node->type==CMP_NODE_R_RESULT)
-                       return 1;
-       }
-       return 0;
-}
 
 /* called from render pipeline, to tag render input and output */
 void ntreeCompositTagRender(bNodeTree *ntree)
index 9c927c80c7e1b6ea4e58ea59cdf912affc22ba21..df8a6042a0fba1faec86934f98c6795c826b479d 100644 (file)
@@ -291,13 +291,13 @@ void set_scene_bg(Scene *sce)
                ob->ctime= -1234567.0;  /* force ipo to be calculated later */
                base= base->next;
        }
-       // full animation update
-       scene_update_for_newframe(sce, sce->lay);
+       /* no full animation update, this to enable render code to work (render code calls own animation updates) */
        
        /* do we need FRAMECHANGED in set_scene? */
 //     if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
 }
 
+/* called from creator.c */
 void set_scene_name(char *name)
 {
        Scene *sce;
@@ -468,7 +468,7 @@ void scene_update_for_newframe(Scene *sce, unsigned int lay)
                if(sce->theDag==NULL)
                        DAG_scene_sort(sce);
                
-               DAG_scene_update_flags(sce, lay);   // only stuff that moves
+               DAG_scene_update_flags(sce, lay);   // only stuff that moves or needs display still
                
                for(base= sce->base.first; base; base= base->next) {
                        ob= base->object;
index 4f1ce26778d54b200a6eaf07efefb49506e893eb..4f986e5155516b85d3f3c4d3cc605dca2599e53f 100644 (file)
@@ -688,8 +688,10 @@ static PyObject *Scene_makeCurrent( BPy_Scene * self )
 {
        Scene *scene = self->scene;
 
-       if( scene )
+       if( scene ) {
                set_scene( scene );
+               scene_update_for_newframe(scene, scene->lay);
+       }
 
        Py_INCREF( Py_None );
        return Py_None;
index 07d0b0a13150f86fd1901800d2ea869b5cb6e492..dc19862e1a94bf389743eb5a92d940b38a1169fb 100644 (file)
@@ -110,6 +110,7 @@ typedef struct RenderStats {
        int totface, totvert, tothalo, totlamp, totpart;
        short curfield, curblur, curpart, partsdone, convertdone;
        double starttime, lastframetime;
+       char *infostr;
        
 } RenderStats;
 
index 0c5970384bb65c113a3d17d392b2473a2f8b9b7b..926470c4b0ddaebfde24a0f23369c5cc4e35c8a7 100644 (file)
@@ -2747,6 +2747,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
        unsigned int lay;
 
        re->scene= scene;
+       
+       re->i.infostr= "Preparing Scene data";
+       re->stats_draw(&re->i);
 
        /* XXX add test if dbase was filled already? */
        
@@ -2895,6 +2898,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                check_non_flat_quads(re);
                set_normalflags(re);
                
+               re->i.infostr= "Creating Shadowbuffers";
+               re->stats_draw(&re->i);
+
                /* SHADOW BUFFER */
                for(go=re->lights.first; go; go= go->next) {
                        LampRen *lar= go->lampren;
@@ -2903,7 +2909,6 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                        if(lar->shb) {
                                makeshadowbuf(re, lar);
                        }
-                       re->stats_draw(&re->i);
                }
                
                /* yafray: 'direct' radiosity, environment maps and octree init not needed for yafray render */
@@ -2914,9 +2919,13 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
                                if(re->r.mode & R_RADIO) do_radio_render(re);
                        
                        /* octree */
-                       if(!re->test_break())
-                               if(re->r.mode & R_RAYTRACE) makeoctree(re);
-                       
+                       if(!re->test_break()) {
+                               if(re->r.mode & R_RAYTRACE) {
+                                       re->i.infostr= "Filling Octree";
+                                       re->stats_draw(&re->i);
+                                       makeoctree(re);
+                               }
+                       }
                        /* ENVIRONMENT MAPS */
                        if(!re->test_break())
                                make_envmaps(re);
@@ -2931,6 +2940,8 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
        else
                re->i.convertdone= 1;
        
+       re->i.infostr= NULL;
+       re->stats_draw(&re->i);
 }
 
 static void database_fromscene_vectors(Render *re, Scene *scene)
index 83c0f88ae71276b32141f015a749333d99d8fec4..7119dccdc65eed10f3479d36f28d0e909fba056c 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 
 #include "DNA_group_types.h"
+#include "DNA_node_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
 
@@ -225,6 +226,7 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop)
        
        /* check renderdata for amount of layers */
        for(srl= re->r.layers.first; srl; srl= srl->next) {
+
                rl= RE_callocN(sizeof(RenderLayer), "new render layer");
                BLI_addtail(&rr->layers, rl);
                
@@ -268,6 +270,9 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop)
                rl->passflag= SCE_PASS_COMBINED;
        }
        
+       /* display active layer */
+       rr->renlay= BLI_findlink(&rr->layers, re->r.actlay);
+       
        return rr;
 }
 
@@ -836,16 +841,91 @@ static void do_render_fields(Render *re)
        
 }
 
+static void do_render_scene_node(Render *re, Scene *sce)
+{
+       Render *resc= RE_NewRender(sce->id.name+2);
+       
+       /* makes render result etc */
+       RE_InitState(resc, &sce->r, re->winx, re->winy, &re->disprect);
+       
+       /* now use renderdata and camera to set viewplane */
+       RE_SetCamera(resc, sce->camera);
+       
+       /* still unsure entity this... */
+       resc->scene= sce;
+       
+       /* ensure scene has depsgraph, base flags etc OK. Warning... also sets G.scene */
+       set_scene_bg(sce);
+
+       /* copy callbacks */
+       resc->display_draw= re->display_draw;
+       resc->test_break= re->test_break;
+       resc->stats_draw= re->stats_draw;
+       
+       if(resc->r.mode & R_FIELDS)
+               do_render_fields(resc);
+       else if(resc->r.mode & R_MBLUR)
+               do_render_blurred(resc, resc->r.cfra);
+       else
+               render_one_frame(resc);
+
+}
+
 static void ntree_render_scenes(Render *re)
 {
-       SceneRenderLayer *srl;
+       bNode *node;
+       
+       if(re->scene->nodetree==NULL) return;
+       
+       /* check for render-result nodes using other scenes, we tag them LIB_DOIT */
+       for(node= re->scene->nodetree->nodes.first; node; node= node->next) {
+               if(node->type==CMP_NODE_R_RESULT) {
+                       if(node->id) {
+                               if(node->id != (ID *)re->scene)
+                                       node->id->flag |= LIB_DOIT;
+                               else
+                                       node->id->flag &= ~LIB_DOIT;
+                       }
+               }
+       }
        
-       for(srl= re->r.layers.first; srl; srl= srl->next) {
-               
+       /* now foreach render-result node tagged we do a full render */
+       /* results are stored in a way compisitor will find it */
+       for(node= re->scene->nodetree->nodes.first; node; node= node->next) {
+               if(node->type==CMP_NODE_R_RESULT) {
+                       if(node->id && node->id != (ID *)re->scene) {
+                               if(node->id->flag & LIB_DOIT) {
+                                       do_render_scene_node(re, (Scene *)node->id);
+                                       node->id->flag &= ~LIB_DOIT;
+                               }
+                       }
+               }
        }
+       
+       /* still the global... */
+       if(G.scene!=re->scene)
+               set_scene_bg(re->scene);
+       
 }
 
-static void do_render_final(Render *re, Scene *scene)
+/* helper call to detect if theres a render-result node */
+int composite_needs_render(Scene *sce)
+{
+       bNodeTree *ntree= sce->nodetree;
+       bNode *node;
+       
+       if(ntree==NULL) return 1;
+       if(sce->use_nodes==0) return 1;
+
+       for(node= ntree->nodes.first; node; node= node->next) {
+               if(node->type==CMP_NODE_R_RESULT)
+                       if(node->id==NULL || node->id!=&sce->id)
+                               return 1;
+       }
+       return 0;
+}
+
+static void do_render_final(Render *re)
 {
        /* we set start time here, for main Blender loops */
        re->i.starttime= PIL_check_seconds_timer();
@@ -856,14 +936,8 @@ static void do_render_final(Render *re, Scene *scene)
                        do_render_seq(re->result);
        }
        else {
-               /* first check if theres nodetree with render result */
-               int do_render= ntreeCompositNeedsRender(scene->nodetree);
-               /* but.. do we use nodes? */
-               if(scene->use_nodes==0) do_render= 1;
                
-               re->scene= scene;
-               
-               if(do_render) {
+               if(composite_needs_render(re->scene)) {
                        /* now use renderdata and camera to set viewplane */
                        RE_SetCamera(re, re->scene->camera);
                        
@@ -875,15 +949,16 @@ static void do_render_final(Render *re, Scene *scene)
                                render_one_frame(re);
                }
                
-               if(!re->test_break()) {
-                       /* checks if there are layer nodes that need scene */
-                       ntree_render_scenes(re);
-                       
-                       ntreeCompositTagRender(scene->nodetree);
-                       ntreeCompositTagAnimated(scene->nodetree);
+               if(!re->test_break() && re->scene->nodetree) {
+                       ntreeCompositTagRender(re->scene->nodetree);
+                       ntreeCompositTagAnimated(re->scene->nodetree);
                        
-                       if(re->r.scemode & R_DOCOMP)
-                               ntreeCompositExecTree(scene->nodetree, &re->r, G.background==0);
+                       if(re->r.scemode & R_DOCOMP) {
+                               /* checks if there are render-result nodes that need scene */
+                               ntree_render_scenes(re);
+                               
+                               ntreeCompositExecTree(re->scene->nodetree, &re->r, G.background==0);
+                       }
                }
        }
        
@@ -999,7 +1074,7 @@ void RE_BlenderFrame(Render *re, Scene *scene, int frame)
        G.rendering= 1;
        
        if(render_initialize_from_scene(re, scene)) {
-               do_render_final(re, scene);
+               do_render_final(re);
        }
 }
 
@@ -1025,7 +1100,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra)
        for(scene->r.cfra= sfra; scene->r.cfra<=efra; scene->r.cfra++) {
                re->r.cfra= scene->r.cfra;      /* weak.... */
                
-               do_render_final(re, scene);
+               do_render_final(re);
                
                /* write image or movie */
                if(re->test_break()==0) {
index ed8f6d81ba9ea15f8db33a764b850109b37956bb..c510c34c9a1cf3ddfc23be9e8c1a0a1545a06a28 100644 (file)
@@ -663,22 +663,77 @@ static int node_composit_buts_image(uiBlock *block, bNodeTree *ntree, bNode *nod
                return 19;
 }
 
-static char *scene_layer_menu(void)
+/* if we use render result from other scene, we make a nice title */
+static void set_render_result_title(void *node_v, void *unused)
 {
+       bNode *node= node_v;
+       Scene *sce;
        SceneRenderLayer *srl;
-       int len= 32 + 32*BLI_countlist(&G.scene->r.layers);
+       char str[64];
+       
+       if(node->id) {
+               BLI_strncpy(str, node->id->name+2, 21);
+               strcat(str, "|");
+               sce= (Scene *)node->id;
+       }
+       else {
+               str[0]= 0;
+               sce= G.scene;
+       }
+       srl= BLI_findlink(&sce->r.layers, node->custom1);
+       if(srl==NULL) {
+               node->custom1= 0;
+               srl= sce->r.layers.first;
+       }
+       
+       strcat(str, srl->name);
+       BLI_strncpy(node->name, str, 32);
+}
+
+static char *scene_layer_menu(Scene *sce)
+{
+       SceneRenderLayer *srl;
+       int len= 32 + 32*BLI_countlist(&sce->r.layers);
        short a, nr;
        char *str= MEM_callocN(len, "menu layers");
        
        strcpy(str, "Active Layer %t");
        a= strlen(str);
-       for(nr=0, srl= G.scene->r.layers.first; srl; srl= srl->next, nr++) {
+       for(nr=0, srl= sce->r.layers.first; srl; srl= srl->next, nr++) {
                a+= sprintf(str+a, "|%s %%x%d", srl->name, nr);
        }
        
        return str;
 }
 
+static void node_browse_scene_cb(void *ntree_v, void *node_v)
+{
+       bNodeTree *ntree= ntree_v;
+       bNode *node= node_v;
+       Scene *sce;
+       
+       if(node->menunr<1) return;
+       
+       if(node->id) {
+               node->id->us--;
+               node->id= NULL;
+       }
+       sce= BLI_findlink(&G.main->scene, node->menunr-1);
+       if(sce!=G.scene) {
+               node->id= &sce->id;
+               id_us_plus(node->id);
+       }
+       
+       set_render_result_title(node, NULL);
+       nodeSetActive(ntree, node);
+
+       allqueue(REDRAWBUTSSHADING, 0);
+       allqueue(REDRAWNODE, 0);
+       NodeTagChanged(ntree, node); 
+
+       node->menunr= 0;
+}
+
 
 static int node_composit_buts_renderresult(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
 {
@@ -686,11 +741,22 @@ static int node_composit_buts_renderresult(uiBlock *block, bNodeTree *ntree, bNo
                uiBut *bt;
                char *strp;
                
-               strp= scene_layer_menu();
+               /* browse button scene */
+               uiBlockBeginAlign(block);
+               IDnames_to_pupstring(&strp, NULL, "", &(G.main->scene), NULL, NULL);
+               node->menunr= 0;
+               bt= uiDefButS(block, MENU, B_NOP, strp, 
+                                         butr->xmin, butr->ymin, 20, 19, 
+                                         &node->menunr, 0, 0, 0, 0, "Browse Scene to use RenderLayer from");
+               uiButSetFunc(bt, node_browse_scene_cb, ntree, node);
+               if(strp) MEM_freeN(strp);
+               
+               /* browse button layer */
+               strp= scene_layer_menu(node->id?(Scene *)node->id:G.scene);
                bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp, 
-                                 butr->xmin, butr->ymin, (butr->xmax-butr->xmin), 19, 
+                                 butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-20, 19, 
                                  &node->custom1, 0, 0, 0, 0, "Choose Render Layer");
-               uiButSetFunc(bt, node_but_title_cb, node, bt);
+               uiButSetFunc(bt, set_render_result_title, node, NULL);
                MEM_freeN(strp);
        }
        return 19;
index 2bf3eb7bae757e49c015d0133bd93d52c0666d98..4528c2125f45e71dd21298438918b857625ac5a5 100644 (file)
@@ -128,7 +128,9 @@ void set_scene(Scene *sce)          /* also see scene.c: set_scene_bg() */
                sc= sc->id.next;
        }
 
-       set_scene_bg(G.scene);  
+       set_scene_bg(G.scene);
+       scene_update_for_newframe(G.scene, G.scene->lay);
+
        set_radglobal();
                
        /* complete redraw */
index 5330531d32aca103aebe01bcbf9fcd308585a4f8..2aca3e7d4bc2c05e0b84c0cd72bf64566bc4760f 100644 (file)
@@ -1603,7 +1603,6 @@ static int node_uiDoBlocks(SpaceNode *snode, ListBase *lb, short event)
                                
                                lb->first= lb->last= node->block;
                                retval= uiDoBlocks(lb, event);
-                               
                                ((struct Link *)node->block)->prev= prev;
 
                                break;
index 3d534744ed32f89ec012390455e4b7f90b09a578..24995f224229e11e497f8e5dadfa8031c1921920 100644 (file)
@@ -1263,9 +1263,12 @@ static int ui_do_but_MENU(uiBut *but)
        ui_check_but(but);
        /* no draw of button now, for floating panels the matrix now is invalid...
           the button still is active, and will be redrawn in main loop to de-activate it */
+       /* but, if no hilites, we send redraw to queue */
+       if(but->flag & UI_NO_HILITE)
+               addqueue(but->block->winq, REDRAW, 1);
        
        uibut_do_func(but);
-
+       
        /* return no existing event, because the menu sends events instead */
        return -1;
 }
index 8b2c0093b3e3c37e834994eae217b210a884456c..5d98753fdae629ed09129bc3f661f5b1c3858933 100644 (file)
@@ -643,7 +643,7 @@ void calc_renderwin_rectangle(int rectx, int recty, int posmask, int renderpos_r
 /* init renderwin, alloc/open/resize */
 static void renderwin_init_display_cb(RenderResult *rr) 
 {
-       if (G.afbreek == 0) {
+       if (G.afbreek != 1) {
                int rendersize[2], renderpos[2], imagesize[2];
 
                calc_renderwin_rectangle(rr->rectx, rr->recty, G.winpos, renderpos, rendersize);
@@ -808,6 +808,9 @@ static void printrenderinfo_cb(RenderStats *rs)
                BLI_timestr(rs->lastframetime, info_time_str);
                spos+= sprintf(spos, " Time:%s ", info_time_str);
                
+               if(rs->infostr)
+                       spos+= sprintf(spos, " | %s", rs->infostr);
+               
                if(render_win) {
                        if(render_win->render_text) MEM_freeN(render_win->render_text);
                        render_win->render_text= BLI_strdup(str);
@@ -1026,28 +1029,12 @@ void BIF_do_render(int anim)
                }
        }
 
-       /* if start render in 3d win, use layer from window (e.g also local view) */
-       if(curarea && curarea->spacetype==SPACE_VIEW3D) {
-               int lay= G.scene->lay;
-               /*
-                * if view is defined (might not be if called form script), check
-                * and set layers
-                */
-               if(G.vd) {
-                       if(G.vd->lay & 0xFF000000)      // localview
-                               G.scene->lay |= G.vd->lay;
-                       else
-                               G.scene->lay= G.vd->lay;
-               }
-               
-               do_render(anim);
-               
-               G.scene->lay= lay;
-       }
-       else do_render(anim);
+       do_render(anim);
 
-       if(G.scene->use_nodes)
+       if(G.scene->use_nodes) {
                allqueue(REDRAWNODE, 1);
+               allqueue(REDRAWIMAGE, 1);
+       }
        if (slink_flag) G.f |= G_DOSCRIPTLINKS;
        if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_POSTRENDER);
 }
index cc39294231f9e0c824552bcc309cf169c9fe1fe9..65446317a3f6ede89801d4d15f53b4b41aeeee59 100644 (file)
@@ -1993,7 +1993,7 @@ void do_build_seqar_cfra(ListBase *seqbase, Sequence ***seqar, int cfra)
                                                int redisplay= (!G.background && !(G.rendering));
                                                
                                                oldsce= G.scene;
-                                               if(seq->scene!=G.scene) set_scene_bg(seq->scene);       /* set_scene does full dep updates */
+                                               if(seq->scene!=G.scene) set_scene_bg(seq->scene);
 
                                                /* prevent eternal loop */
                                                doseq= G.scene->r.scemode & R_DOSEQ;
index ec16fb89fa34835ac34036e03885333a34fa6191..c7926d007150ff1949d000dd8f699062d8911204 100644 (file)
@@ -459,6 +459,7 @@ void start_game(void)
                 * Better would be to make a better routine
                 * in the game engine for finding the camera.
                 *  - zr
+                * Note: yes, this is all very badly hacked! (ton)
                 */
        for (sc= G.main->scene.first; sc; sc= sc->id.next) {
                if (!sc->camera) {
@@ -500,7 +501,8 @@ void start_game(void)
 
        restore_all_scene_cfra(scene_cfra_store);
        set_scene_bg(startscene);
-       
+       scene_update_for_newframe(G.scene, G.scene->lay);
+
        if (G.flags & G_FILE_AUTOPLAY)
                exit_usiblender();