diff options
Diffstat (limited to 'source/blender/editors/space_clip/tracking_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index e9006f5b1e9..1b08a9aee4c 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -1504,24 +1504,6 @@ void CLIP_OT_track_markers(wmOperatorType *ot) /********************** solve camera operator *********************/ -static int check_solve_track_count(MovieTracking *tracking) -{ - int tot= 0; - int frame1= tracking->settings.keyframe1, frame2= tracking->settings.keyframe2; - MovieTrackingTrack *track; - - track= tracking->tracks.first; - while(track) { - if(BKE_tracking_has_marker(track, frame1)) - if(BKE_tracking_has_marker(track, frame2)) - tot++; - - track= track->next; - } - - return tot>=8; -} - static int solve_camera_exec(bContext *C, wmOperator *op) { SpaceClip *sc= CTX_wm_space_clip(C); @@ -1530,9 +1512,11 @@ static int solve_camera_exec(bContext *C, wmOperator *op) MovieTracking *tracking= &clip->tracking; int width, height; float error; + char error_msg[255]; + + if(!BKE_tracking_can_solve(tracking, error_msg, sizeof(error_msg))) { + BKE_report(op->reports, RPT_ERROR, error_msg); - if(!check_solve_track_count(tracking)) { - BKE_report(op->reports, RPT_ERROR, "At least 8 tracks on both of keyframes are needed for reconstruction"); return OPERATOR_CANCELLED; } |