Keyframe woes

beugnet wrote on 3/30/2006, 10:17 PM
Hello all,

I seem to have stumbled upon a very annoying problem (possibly bug?). Wonder if anyone else has it or at least have a workaround to suggest.
All I'm trying to do is to animate a resize (pan/crop) of an image, that starts off linearly and ends with a smooth stop.
It just doesnt work. I get either an animation that starts and end smoothly, or its all linear (abrupt start and stop).
I've spent some extensive time on this.
It seems it only concerns scaling and rotation. When I just translate the clip I get exactly what I want (by fiddling around with the smoothness parameter of the keyframe interpolation).
Has anyone got some ideas on this? It seems weird that with all the interpolation option I cant do want I want.


Beugnet

Comments

Tattoo wrote on 3/31/2006, 10:58 AM
Beugnet-

I can't say this is the fix to your problem, but have you tried setting all of your keyframes to a smoothness value of 0, and then set each keyframe to be "linear," "smooth," "slow," etc. as you desire. I don't think the smoothness value has anything to do with how smooth the keyframe transition is. For example, if you have four keyframes to pan something in a square pattern, with a smoothness of 0 it'll pan in a square. With a smoothness of 1, it'll blend the pans into more of a rounded, circular motion.

This may not be your fix, but Sony's default setting of 1on the smoothness has caused plenty of mysteries in the past, including for me. Unfortunately there's no way to change the default setting.

Brian
Trichome wrote on 4/5/2006, 1:43 PM
Try this script by James Trietsch, he's an awsome programmer!:
_________________________



/**********
* Zero Smooth - Sets all video keyframe smoothness properties to zero
* by James Trietsch
* (A modification of match_aspect_ratio.js)
**********/

import Sony.Vegas;
import System.Windows.Forms;

var tCount = Vegas.Project.Tracks.Count;

for (var i=0; i < tCount; i++) {
var track = Vegas.Project.Tracks[i];

if (!track.IsVideo())
continue;

var events = new Enumerator(track.Events);

while (!events.atEnd()) {
var tEvent = events.item();
var mStream = GetActiveMediaStream(tEvent);

if (mStream) {
var vStream = VideoStream(mStream);
var keys = VideoEvent(tEvent).VideoMotion.Keyframes;
var kCount = keys.Count;

for (var j=0; j<kCount; j++) {
keys[j].Smoothness = 0;
}
}

events.moveNext();
}
}


// Copied from Match Aspect Ratio script
function GetActiveMediaStream (trackEvent : TrackEvent)
{
try
{
if ( ! trackEvent.ActiveTake.IsValid())
{
throw "empty or invalid take";
}

var media = Vegas.Project.MediaPool.Find (trackEvent.ActiveTake.MediaPath);

if (null == media)
{
throw "missing media";
}

var mediaStream = media.Streams.GetItemByMediaType (MediaType.Video, trackEvent.ActiveTake.StreamIndex);

return mediaStream;
}
catch (e)
{
//MessageBox.Show(e);
return null;
}
}

johnmeyer wrote on 4/5/2006, 1:50 PM
There is a similar script here:

UnSmooth Keyframes
beugnet wrote on 4/6/2006, 6:28 AM
Thanks for everyones help but it still doesnt work. It really seems to be linked to the scaling (and rotation for that matter) rather than the translation of the crop.

. When I crop and animate a pan I can actually contol the smothness of the keys. I can have the pan start abruptly (linear) and stop gradually (smooth).
. When I want to animate the size of the crop (scaling), I cant seem to be able to have the pan start linear and end smoothly (gradually). Its either all smoothed or or linear.

The two examples above have just 2 keys for example sake.
After extensive tests (fiddling around with the smoothness parameter, trying out all of the interpolation modes), it seems that its the animated resizing and rotation that doesnt work as it should.
I'm starting to wonder if that isnt linked to the fact that only POSITION track key is available in Event Pan/Crop (And by the way, it would be cool to have different tracks for rotation, scaling and whatever.And also, I'm dreaming, a proper graph editor).

If anyone else has some ideas...
Thansk a lot,

Beugnet
beugnet wrote on 4/10/2006, 8:41 AM
Ok nevermind. I found the answer. Here it goes for posterity :)

. Put the first keyframe as FAST and the last one as SMOOTH.

I got confused by my CG background. Vegas's LINEAR option doesnt seem to react the same way as in a 3D software.
Voila.

Beugnet