Camera tracking fixes

- Dopesheet should be invalidated after solution
- Prevent crash when non-camera object is set as scene camera
This commit is contained in:
Sergey Sharybin
2012-10-26 12:36:50 +00:00
parent de72ffa69b
commit 9b110f2f64
2 changed files with 4 additions and 4 deletions

View 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;

View 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;