Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-02-10 14:46:01 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-02-10 14:48:45 +0300
commitae863f34df870af416b4728e65d4b6eef93a4d30 (patch)
tree674785cccb13f81ae9ecd4b3b6aa4af353c2bd59
parent0f07848efe631544d93b9c151bf2532645b5aac9 (diff)
Tracking: Clarify calculation of camera matrix for object solver
It might be confusing why matrix is constructed from scratch rather than using already calculated one.
-rw-r--r--source/blender/blenkernel/intern/tracking.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 58f58417084..d2038c34056 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -398,6 +398,16 @@ MovieTrackingReconstruction *BKE_tracking_get_active_reconstruction(MovieTrackin
void BKE_tracking_get_camera_object_matrix(Object *camera_object, float mat[4][4])
{
BLI_assert(camera_object != NULL);
+ /* NOTE: Construct matrix from scratch rather than using obmat because the camera object here
+ * will have camera solver constraint taken into account. But here we do not want or need it:
+ * object is solved in camera space (as in, camera is stationary and object is moving).
+ *
+ * This will include animation applied on the camera, but not possible camera rig. This isn't
+ * an issue in practice due to the way how VFX is constructed.
+ *
+ * If we ever need to support crazy setups like that one possible solution would be to use
+ * final camera matrix and multiple it by an inverse of solved camera matrix at the current
+ * frame. */
BKE_object_where_is_calc_mat4(camera_object, mat);
}