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>2012-06-06 22:58:30 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-06 22:58:30 +0400
commitf43a733f591377f2cdce0555443dba003c05fd30 (patch)
tree6574507d07111ea418e5c09ce1adb4feac32561d /source/blender/blenkernel/intern/constraint.c
parent3e3e5b2ea3a8dadfbd1dcfe295ddf28bc2236141 (diff)
Changed semantic of recently added start_frame
Now it's indicates at which scene frame number movie clip starts playing back. This this setting is still belongs to clip datavlock and used by all users of clip such as movie compositor nodes, constraints and so. After long discussion and thoughts about this it was decided that this would match image's current behavior (which initially seen a bit crappy), but that's actually allows: - Keep semantics of start frame in image and clip datablocks in sync - Allows to support features like support of loading image sequences with crappy numbers in suffix which doesn't fit long int. - Allows to eliminate extra boolean checkbox to control such kind of offset. Hopefully from pipeline POV it wouldn't hurt because idea of having this things implemented in original way was working only if sequence before processing started naming form 001.
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index c6a0ecc057a..afd50de8159 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -3897,6 +3897,7 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
MovieTrackingTrack *track;
MovieTrackingObject *tracking_object;
Object *camob = data->camera ? data->camera : scene->camera;
+ int framenr;
if (data->flag & FOLLOWTRACK_ACTIVECLIP)
clip = scene->clip;
@@ -3919,6 +3920,8 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
if (!track)
return;
+ framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scene->r.cfra);
+
if (data->flag & FOLLOWTRACK_USE_3D_POSITION) {
if (track->flag & TRACK_HAS_BUNDLE) {
float obmat[4][4], mat[4][4];
@@ -3930,7 +3933,7 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
copy_m4_m4(mat, camob->obmat);
- BKE_tracking_get_interpolated_camera(tracking, tracking_object, scene->r.cfra, imat);
+ BKE_tracking_get_interpolated_camera(tracking, tracking_object, framenr, imat);
invert_m4(imat);
mul_serie_m4(cob->matrix, obmat, mat, imat, NULL, NULL, NULL, NULL, NULL);
@@ -3969,7 +3972,7 @@ static void followtrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
CameraParams params;
float pos[2], rmat[4][4];
- marker = BKE_tracking_get_marker(track, scene->r.cfra);
+ marker = BKE_tracking_get_marker(track, framenr);
add_v2_v2v2(pos, marker->pos, track->offset);
@@ -4092,8 +4095,9 @@ static void camerasolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
float mat[4][4], obmat[4][4];
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *object = BKE_tracking_get_camera_object(tracking);
+ int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scene->r.cfra);
- BKE_tracking_get_interpolated_camera(tracking, object, scene->r.cfra, mat);
+ BKE_tracking_get_interpolated_camera(tracking, object, framenr, mat);
copy_m4_m4(obmat, cob->matrix);
@@ -4156,10 +4160,11 @@ static void objectsolver_evaluate(bConstraint *con, bConstraintOb *cob, ListBase
if (object) {
float mat[4][4], obmat[4][4], imat[4][4], cammat[4][4], camimat[4][4], parmat[4][4];
+ int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scene->r.cfra);
BKE_object_where_is_calc_mat4(scene, camob, cammat);
- BKE_tracking_get_interpolated_camera(tracking, object, scene->r.cfra, mat);
+ BKE_tracking_get_interpolated_camera(tracking, object, framenr, mat);
invert_m4_m4(camimat, cammat);
mult_m4_m4m4(parmat, cammat, data->invmat);