Old Scripts Broken under 4.0d

johnmeyer wrote on 9/19/2003, 11:46 AM
I just tried to run two scripts that I wrote using either 4.0a or 4.0b. They don't work under 4.0d. Here's a link to one of the scripts:

Trim n Frames and Ripple

The problem is that the ripple of subsequent events now causes the rippled event to become offset, so that the end plays first (i.e., the little white "diamond" appears at the top of the track).

Something changed in 4.0d that caused rippling to change. I'll see if I can figure out what needs to be changed. <sigh>

I think the problem is in the statement:

evnt.Start=evnt.Start-DeleteFrames;

This used to move the event to the left by the number of frames given in DeleteFrames. Now it moves the event, but the contents of the event stay at the same point in the timeline.


To help explain that one line of code above:

var eventEnum = new Enumerator(track.Events);
evnt = TrackEvent(eventEnum.item());

also:


var DeleteFrames : Timecode = new Timecode("00:00:00:00");
DeleteFrames = Vegas.Cursor - Timecode(evnt.Start);

Comments

jetdv wrote on 9/19/2003, 1:04 PM
What if you do this?

SaveOffset = evnt.ActiveTake.Offset;
evnt.Start=evnt.Start-DeleteFrames;
evnt.ActiveTake.Offset = SaveOffset;

I've always had to readjust the offset when changing the start to get it to work correctly.
johnmeyer wrote on 9/19/2003, 1:11 PM
Edward,

Thanks for the idea. I just found another way to do it, using one of the new API calls. I changed the original line:

evnt.Start=evnt.Start-DeleteFrames;

to this:

evnt.AdjustStartLength(evnt.Start-DeleteFrames, evnt.Length, true);

SoFo, if you're listenting, this definitely changed from the earlier releases. I guess there are probably not too many scripts out there, so this isn't too big a deal, but you might want to tuck this away in some database so people know about it.