Camera tracking fixes
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 26 Oct 2012 12:36:50 +0000 (12:36 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 26 Oct 2012 12:36:50 +0000 (12:36 +0000)
- Dopesheet should be invalidated after solution
- Prevent crash when non-camera object is set as scene camera

source/blender/blenkernel/intern/tracking.c
source/blender/editors/space_clip/tracking_ops.c

index e6904a23d51054d7d1005172835908532da32b0b..9d422b0d28d0ce611676fbc1ccfc6fd482db1a3b 100644 (file)
@@ -2138,7 +2138,7 @@ void BKE_tracking_context_sync(MovieTrackingContext *context)
 
        context->sync_frame = newframe;
 
-       tracking->dopesheet.ok = FALSE;
+       BKE_tracking_dopesheet_tag_update(tracking);
 }
 
 void BKE_tracking_context_sync_user(const MovieTrackingContext *context, MovieClipUser *user)
@@ -2953,6 +2953,7 @@ int BKE_tracking_reconstruction_finish(MovieReconstructContext *context, MovieTr
        MovieTrackingReconstruction *reconstruction;
 
        tracks_map_merge(context->tracks_map, tracking);
+       BKE_tracking_dopesheet_tag_update(tracking);
 
        if (context->is_camera) {
                reconstruction = &tracking->reconstruction;
@@ -3651,7 +3652,7 @@ static void channels_segments_calc(MovieTrackingDopesheetChannel *channel)
        }
 }
 
-static void  tracking_dopesheet_sort(MovieTracking *tracking, int sort_method, int inverse)
+static void tracking_dopesheet_sort(MovieTracking *tracking, int sort_method, int inverse)
 {
        MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
 
index 521b1383db833d66ce251791dbbfcf1070ee9bbc..2f1265b6a4da4247e6c40a19b247df086ce293fb 100644 (file)
@@ -1396,7 +1396,6 @@ static void solve_camera_freejob(void *scv)
        }
 
        solved = BKE_tracking_reconstruction_finish(scj->context, tracking);
-
        if (!solved)
                BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details");
        else
@@ -1410,7 +1409,7 @@ 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) {
+       if (scene->camera && GS(scene->camera->id.name) == ID_CA) {
                Camera *camera = (Camera *)scene->camera->data;
                int width, height;