Fix one more crash introduced with r36384: trying to bake resulted in a segfault
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 30 Apr 2011 13:47:25 +0000 (13:47 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 30 Apr 2011 13:47:25 +0000 (13:47 +0000)
Also, use tabs for indentation in previous fix for the same crash

source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c

index 9d96bd756dfac1d467da23bb77c38cb6bd215617..74ce7957dd757e491b5faa6f1a248b61d861abe2 100644 (file)
@@ -5659,7 +5659,7 @@ void RE_Database_FromScene_Vectors(Render *re, Main *bmain, Scene *sce, unsigned
 */
 void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay, int type, Object *actob)
 {
-       Object *camera= RE_GetCamera(re);
+       Object *camera;
        float mat[4][4];
        float amb[3];
        int onlyselected, nolamps;
@@ -5701,6 +5701,8 @@ void RE_Database_Baking(Render *re, Main *bmain, Scene *scene, unsigned int lay,
        if(re->lay & 0xFF000000)
                lay &= 0xFF000000;
        
+       camera= RE_GetCamera(re);
+       
        /* if no camera, set unit */
        if(camera) {
                normalize_m4(camera->obmat);
index 07b9657b5fe5201afd4c171a2222bfbe10a0df7e..436f0ecd9974f242de77b2f9cab983d74c655c4d 100644 (file)
@@ -3149,7 +3149,7 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
        re->scene = sce;
        re->lay = sce->lay;
 
-    camera = RE_GetCamera(re);
+       camera = RE_GetCamera(re);
        RE_SetCamera(re, camera);
 
        do_render_3d(re);