Modify clip length?

MomentsVideos wrote on 4/22/2005, 5:16 PM

I have a script for making a clip slow motion. I always need to resize the clip afterwards. Is there a way of sizing the clip up so that the entire clip is there? The slo mo clip is below (for 33%)

import Sony.Vegas;

for (var track in Vegas.Project.Tracks)
{
if (track.MediaType != MediaType.Video)
{
continue ;
}
for (var evt in track.Events)
{
if (evt.Selected)
{
var velocityEnvelope = null ;
for (var env in evt.Envelopes)
{
if (env.Type == EnvelopeType.Velocity)
{
velocityEnvelope = env ;
break ;
}
}
if (velocityEnvelope != null)
{
evt.Envelopes.Remove(velocityEnvelope) ;
}

velocityEnvelope = new Envelope(EnvelopeType.Velocity) ;
evt.Envelopes.Add(velocityEnvelope) ;
var pt = velocityEnvelope.Points[0] ;
pt.Y = 0.33 ; // 33%

var IncTime : Timecode = new Timecode(evt.Length);

IncTime = IncTime * 2;
evt.Length = IncTime ;
}
}
}

Comments

pelladon wrote on 4/23/2005, 5:49 PM
remove the statement

IncTime = IncTime *2;

then you shouldn't have to resize. But you don't get the whole clip of course.

If you want the whole clip, try this:

IncTime = IncTime + IncTime + IncTime;

The Timecode class doesn't have a multiplication method.