Do not set scene's camera on camera solving and cursor snapping
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 31 Dec 2011 08:26:32 +0000 (08:26 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 31 Dec 2011 08:26:32 +0000 (08:26 +0000)
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_snap.c

index 2178d6d9cc64379035ebffc3c89133d15610bba9..d6940d14dbf1c0a15bf6d56e982391d9f4b8512c 100644 (file)
@@ -1613,9 +1613,6 @@ static void solve_camera_freejob(void *scv)
        id_us_plus(&clip->id);
 
        /* set blender camera focal length so result would look fine there */
-       if(!scene->camera)
-               scene->camera= scene_find_camera(scene);
-
        if(scene->camera) {
                Camera *camera= (Camera*)scene->camera->data;
                int width, height;
@@ -2468,16 +2465,16 @@ static int do_set_scale(bContext *C, wmOperator *op, int scale_solution)
                if(tracking_object->flag&TRACKING_OBJECT_CAMERA) {
                        mul_v3_fl(object->size, scale);
                        mul_v3_fl(object->loc, scale);
-               } else
-               if(!scale_solution){
-                       Object *camera= object_solver_camera(scene, object);
+               }
+               else if(!scale_solution){
+                       Object *solver_camera= object_solver_camera(scene, object);
 
                        object->size[0]= object->size[1]= object->size[2]= 1.0f/scale;
 
-                       if(camera) {
-                               object->size[0]/= camera->size[0];
-                               object->size[1]/= camera->size[1];
-                               object->size[2]/= camera->size[2];
+                       if(solver_camera) {
+                               object->size[0]/= solver_camera->size[0];
+                               object->size[1]/= solver_camera->size[1];
+                               object->size[2]/= solver_camera->size[2];
                        }
                }
                else {
index 80b7522d1a3c417377102dd8e80445582028f2c0..d3a0ee272563cbb7097e7c9d6f5b556ff466da5c 100644 (file)
@@ -1521,9 +1521,6 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d)
                                clip= NULL;
 
                                if(bgpic->flag&V3D_BGPIC_CAMERACLIP) {
-                                       if(!scene->camera)
-                                               scene->camera= scene_find_camera(scene);
-
                                        if(scene->camera)
                                                clip= object_get_movieclip(scene, scene->camera, 1);
                                } else clip= bgpic->clip;
index ac1c71cd344a7a3a46402b8967afec6a82fe1633..ad2a0da45105211a1578b2d3572efdf300acea67 100644 (file)
@@ -768,10 +768,6 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
 
        tracking= &clip->tracking;
 
-       /* XXX - seems like an unneeded side effect, snapping should _not_ set the active camera for eg. - campbell */
-       if(!scene->camera)
-               scene->camera= scene_find_camera(scene);
-
        if(scene->camera)
                copy_m4_m4(cammat, scene->camera->obmat);