Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro ApplyTransitions.js – Apply crossfades to SELECTED events only?

  • Graham Bernard

    April 11, 2009 at 7:16 am

    You want to make a selections of Events to Crossfade – move over each other – by using a script? Is that it? Well, as I have Excalibur I can utilize his “Gap/Overlap” script as part of Edward Troxel’s (jetdv) Excalibur package. Maybe this is only available within Excalibur, Jill? As to can it be modified for your requirements, I’d be calling the Author – in this case Edward T? Edward is very helpful. Try a free download of Excalbur too!

    You would also be advised to download Johnny Rofrano’s UltimateS Pro 4, he – jr – provides much support on these boards. Johnny has a feature rich set of tools for Event fades and L and J cuts – it is just stacked with options.

    Grazie

  • Edward Troxel

    April 11, 2009 at 2:19 pm

    Basically, you would need to take this section:

    while (!eventEnum.atEnd()) {
    var ev = eventEnum.item();

    ev.FadeIn.Curve = CurveType.Slow
    if (bRandom) {
    num = int(Math.random() * totalTrans + 1);
    if (num > 23) {
    num = totalTrans - 1;
    }
    plugIn = Vegas.Transitions.GetChild(int(num));
    }

    var startTime = ev.Start.ToMilliseconds();
    var length = ev.Length.ToMilliseconds();

    startTime = ev.Start - startoffset;
    if (startTime.ToMilliseconds() < 0) {
    startTime = new Timecode("00:00:00:00");
    startoffset = startoffset - overlapTime;
    }

    var currTake = ev.ActiveTake;
    var currOffset = currTake.Offset;
    ev.Start = startTime;
    currTake.Offset = currOffset;

    Vegas.UpdateUI();

    if(ev.MediaType == MediaType.Video && !bFade) {
    fx = new Effect(plugIn);
    ev.FadeIn.Transition = fx;
    }

    eventEnum.moveNext();
    startoffset = startoffset + overlapTime;
    }

    and add the code to ONLY affect selected events such as:

    while (!eventEnum.atEnd()) {
    var ev = eventEnum.item();

    if (ev.Selected) {

    ev.FadeIn.Curve = CurveType.Slow
    if (bRandom) {
    num = int(Math.random() * totalTrans + 1);
    if (num > 23) {
    num = totalTrans - 1;
    }
    plugIn = Vegas.Transitions.GetChild(int(num));
    }

    var startTime = ev.Start.ToMilliseconds();
    var length = ev.Length.ToMilliseconds();

    startTime = ev.Start - startoffset;
    if (startTime.ToMilliseconds() < 0) {
    startTime = new Timecode("00:00:00:00");
    startoffset = startoffset - overlapTime;
    }

    var currTake = ev.ActiveTake;
    var currOffset = currTake.Offset;
    ev.Start = startTime;
    currTake.Offset = currOffset;

    Vegas.UpdateUI();

    if(ev.MediaType == MediaType.Video && !bFade) {
    fx = new Effect(plugIn);
    ev.FadeIn.Transition = fx;
    }

    eventEnum.moveNext();
    startoffset = startoffset + overlapTime;
    }
    }

    To be honest, you’d probably be better off by ONLY letting it affect a selected TRACK instead. To do that, you would but this around the highlighted code above:

    if (tr.Selected) {

    (put the While (!trackEnum.atEnd... loop listed above here)

    }

    Edward Troxel
    JETDV Scripts

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy