Bugfix [#8196] sequencer crash when adding scene without camera
authorCampbell Barton <ideasman42@gmail.com>
Sun, 17 Feb 2008 20:44:07 +0000 (20:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 17 Feb 2008 20:44:07 +0000 (20:44 +0000)
added checks for a camera
Also added an error ob bake if there are no active objects.

source/blender/render/intern/source/rendercore.c
source/blender/src/meshtools.c
source/blender/src/sequence.c

index c1b941b668150ffc932f0488e1257057121e8b81..da468e66d48fa22b2a7a571d77e0a33e5be516fc 100644 (file)
@@ -2255,7 +2255,7 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob)
        }
        
        /* calculate return value */
-       for(a=0; a<re->r.threads; a++) {
+       for(a=0; a<re->r.threads; a++) {
                vdone+= handles[a].vdone;
                
                zbuf_free_span(handles[a].zspan);
index 15515f2b0ba3939a847d3a60dec41f39d49e8ee5..9eb1051e892aee487d51e8c63f9a0e1d6797fe13 100644 (file)
@@ -1041,9 +1041,11 @@ void objects_bake_render(short event, char **error_msg)
                return;
        }        
        
-       if(active && !actob)
+       if(active && !actob) {
+               *error_msg = "No active object";
                return;
-               
+       }
+       
        if(event>0) {
                Render *re= RE_NewRender("_Bake View_");
                ScrArea *area= biggest_image_area();
index de5b1d708f2efb4a3b7a0d06d28a9b88d0d3bb6b..ad379826016743f27ec5d65cd0e4735c15bfb152 100644 (file)
@@ -1651,14 +1651,16 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
                int doseq, rendering= G.rendering;
                char scenename[64];
                        
-               if (se->ibuf==NULL && seq->scene && !build_proxy_run) {
+               if (se->ibuf==NULL && seq->scene && seq->scene->camera && !build_proxy_run) {
                        se->ibuf = seq_proxy_fetch(seq, cfra);
                        if (se->ibuf) {
                                input_preprocess(seq, se, cfra);
                        }
                }
-
-               if (se->ibuf==NULL && seq->scene) {
+               
+               if (seq->scene && seq->scene->camera==NULL) {
+                       se->ok = STRIPELEM_FAILED;
+               } else if (se->ibuf==NULL && seq->scene && seq->scene->camera) {
                        waitcursor(1);
                        
                        /* Hack! This function can be called from do_render_seq(), in that case
@@ -1715,7 +1717,11 @@ static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra,
                        CFRA = oldcfra;
 
                        if (!build_proxy_run) {
-                               input_preprocess(seq, se, cfra);
+                               if(se->ibuf == NULL) {
+                                       se->ok = STRIPELEM_FAILED;
+                               } else {
+                                       input_preprocess(seq, se, cfra);
+                               }
                        }
 
                }