diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-08-01 18:05:53 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-01 18:05:53 +0300 |
commit | 03bbd5f9dedf7b3dfea7119c172c61f0b50ae28c (patch) | |
tree | 79ab34e79af6a700c6f73f331e4ee4e253ab3751 /source/blender/blenkernel/intern/tracking_solver.c | |
parent | 2204bfcf9e1c3a38e60830bd97775dd72158f4d6 (diff) | |
parent | 49b2162309da6abf66764d41d9fc4c45ad01936c (diff) |
Merge branch 'master' into temp-gpencil-drw-engine
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_solver.c')
-rw-r--r-- | source/blender/blenkernel/intern/tracking_solver.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/tracking_solver.c b/source/blender/blenkernel/intern/tracking_solver.c index cfa41cb7d92..7e7a839b645 100644 --- a/source/blender/blenkernel/intern/tracking_solver.c +++ b/source/blender/blenkernel/intern/tracking_solver.c @@ -65,6 +65,9 @@ typedef struct MovieReconstructContext { TracksMap *tracks_map; int sfra, efra; + + /* Details about reconstruction error, reported by Libmv. */ + char error_message[1024]; } MovieReconstructContext; typedef struct ReconstructProgressData { @@ -426,9 +429,26 @@ MovieReconstructContext *BKE_tracking_reconstruction_context_new(MovieClip *clip context->keyframe2 = keyframe2; context->refine_flags = reconstruct_refine_intrinsics_get_flags(tracking, object); + context->error_message[0] = '\0'; + return context; } +void BKE_tracking_reconstruction_report_error_message(MovieReconstructContext *context, + const char *error_message) +{ + if (context->error_message[0]) { + /* Only keep initial error message, the rest are inducted ones. */ + return; + } + BLI_strncpy(context->error_message, error_message, sizeof(context->error_message)); +} + +const char *BKE_tracking_reconstruction_error_message_get(const MovieReconstructContext *context) +{ + return context->error_message; +} + /* Free memory used by a reconstruction process. */ void BKE_tracking_reconstruction_context_free(MovieReconstructContext *context) { @@ -534,7 +554,8 @@ bool BKE_tracking_reconstruction_finish(MovieReconstructContext *context, MovieT MovieTrackingObject *object; if (!libmv_reconstructionIsValid(context->reconstruction)) { - printf("Failed solve the motion: most likely there are no good keyframes\n"); + BKE_tracking_reconstruction_report_error_message( + context, "Failed to solve the motion: most likely there are no good keyframes"); return false; } |