2D stabilization: by default init anchor_frame to frame 1
authorIchthyostega <prg@ichthyostega.de>
Mon, 22 Aug 2016 15:29:19 +0000 (17:29 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 23 Aug 2016 09:53:35 +0000 (11:53 +0200)
It is common in blender to use 1-based counting for
frame sequences (while 0-based is allowed). Thus
initializing to use frame 1 as reference for stabilization
is likely to produce smooth start values in most cases

source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/versioning_270.c

index d5d3384bb48894a7083beb3a41eb4d7b13e39c58..a86606f1099bf2f4f6b92a5b0313262498a55959 100644 (file)
@@ -330,7 +330,7 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
        tracking->settings.object_distance = 1;
 
        tracking->stabilization.scaleinf = 1.0f;
-       tracking->stabilization.anchor_frame = MINFRAME;
+       tracking->stabilization.anchor_frame = 1;
        zero_v2(tracking->stabilization.target_pos);
        tracking->stabilization.target_rot = 0.0f;
        tracking->stabilization.scale = 1.0f;
index 1ef32d6f0067b5989943ee219f038b02113735c4..49ef8baa184c73542cc626baacef38621673cf33 100644 (file)
@@ -1373,6 +1373,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                                         * now used always (as "target scale") */
                                        clip->tracking.stabilization.scale = 1.0f;
                                }
+                               /* blender prefers 1-based frame counting;
+                                * thus using frame 1 as reference typically works best */
+                               clip->tracking.stabilization.anchor_frame = 1;
                                /* by default show the track lists expanded, to improve "discoverability" */
                                clip->tracking.stabilization.flag |= TRACKING_SHOW_STAB_TRACKS;
                                /* deprecated, not used anymore */