FORUMS: list search recent posts

Your assistance John, with one of your previous written scripts?

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Steve Rhoden
Your assistance John, with one of your previous written scripts?
on Feb 3, 2016 at 9:49:28 am

Hey John, you have written a Playback Rate script some years
ago over at the sony forum:
http://www.sonycreativesoftware.com/forums/showmessage.asp?messageid=721016
If possible, can you change this for me, for it to only affect events
that i select?
Currently its set to adjust everything on the timeline, would want for it
to adjust only the ones i select. Thanks again!

Steve Rhoden (Cow Leader)
Film Maker & VFX Artist.
Owner of Filmex Creative Media.
Samples of my Work and Company can be seen here:
http://www.facebook.com/FilmexCreativeMedia


Return to posts index

John Rofrano
Re: Your assistance John, with one of your previous written scripts?
on Feb 3, 2016 at 2:03:28 pm

[Steve Rhoden] "Currently its set to adjust everything on the timeline, would want for it to adjust only the ones i select. Thanks again!"
Sure, no problem. Here is the new script:
//****************************************************************************
//* Program: Fix30pMedia.cs
//* Author: John Rofrano
//* Description: This script changes the playback rate of 30p media to 29.97
//* Created: July 25, 2010
//* Updated: Jul 28, 2010 (JR) Added Disable Resample
//* Aug 4, 2010 (JR) Changed audio to match video
//* Feb 3, 2016 (JR) Changed to only process selected events
//*
//* Copyright: (c) 2010, 2016 Sundance Media Group / VASST. All Rights Reserved
//****************************************************************************
using System;
using System.Collections;
using System.Windows.Forms;
using Sony.Vegas;

class EntryPoint
{
public void FromVegas(Vegas vegas)
{
int counter = 0;
try
{
foreach (Track track in vegas.Project.Tracks)
{
if (!track.IsVideo()) continue;

foreach (VideoEvent videoEvent in track.Events)
{
// Only process selected events
if (!videoEvent.Selected) continue;

VideoStream videoStream = videoEvent.ActiveTake.MediaStream as VideoStream;
decimal frameRate = Math.Round((decimal)videoStream.FrameRate, 2);

// only affect 30fps media
if (frameRate == 30.00m)
{
videoEvent.AdjustPlaybackRate(0.999, true);
videoEvent.ResampleMode = VideoResampleMode.Disable;
counter++;

// check for audio in the same file and change it too
if (videoEvent.IsGrouped)
{
foreach (TrackEvent trackEvent in videoEvent.Group)
{
if (!trackEvent.IsAudio()) continue;

// see if they are from the same file
if (trackEvent.ActiveTake != null && trackEvent.ActiveTake.MediaPath.Equals(videoEvent.ActiveTake.MediaPath))
{
AudioEvent audioEvent = trackEvent as AudioEvent;
audioEvent.AdjustPlaybackRate(0.999, true);
}
}
}
}
}
}

// let the user know we are done
MessageBox.Show(String.Format("{0} events changed", counter), "Complete", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
}

Let me know how it works for you.

~jr

http://www.johnrofrano.com
http://www.vasst.com



Return to posts index

Steve Rhoden
Re: Your assistance John, with one of your previous written scripts?
on Feb 3, 2016 at 4:05:05 pm
Last Edited By Steve Rhoden on Feb 3, 2016 at 4:06:19 pm

Working great. Exactly how i needed it.
Thanks a bunch.
(This Vegas Scripting language is the only part of Vegas i've never
dedicated my time in mastering, lol
)

Steve Rhoden (Cow Leader)
Film Maker & VFX Artist.
Owner of Filmex Creative Media.
Samples of my Work and Company can be seen here:
http://www.facebook.com/FilmexCreativeMedia


Return to posts index


John Rofrano
Re: Your assistance John, with one of your previous written scripts?
on Feb 3, 2016 at 9:20:43 pm

You're welcome Steve. Glad that worked as you expected.

~jr

http://www.johnrofrano.com
http://www.vasst.com



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]