Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 28 Sep 2011 13:31:18 +0000 (13:31 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 28 Sep 2011 13:31:18 +0000 (13:31 +0000)
===========================

- Fixed crash when creating new scene.
- Fixed usage of uninitialized variable.

source/blender/editors/space_view3d/view3d_draw.c

index dba2f8ed08eef43ae1daabba5e0eedd1bec866b5..59a142a784ec7091a367e147f9456c072d954212 100644 (file)
@@ -1487,11 +1487,14 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
                                BKE_image_user_calc_frame(&bgpic->iuser, CFRA, 0);
                                ibuf= BKE_image_get_ibuf(ima, &bgpic->iuser);
                        } else {
+                               clip= NULL;
+
                                if(bgpic->flag&V3D_BGPIC_CAMERACLIP) {
                                        if(!scene->camera)
                                                scene->camera= scene_find_camera(scene);
 
-                                       clip= object_get_movieclip(scene, scene->camera);
+                                       if(scene->camera)
+                                               clip= object_get_movieclip(scene, scene->camera);
                                } else clip= bgpic->clip;
 
                                if(clip==NULL)