-
Change Timing
Posted by Tyson Onaga on August 2, 2009 at 9:16 pmI have two Vegas projects: parent project P and child project C. C has only still images in it, several tracks, Pan/Crop and Track Motion events. C is nested in P. I would like to adjust the timing of C in P, not by a lot … just by a fraction. Now, I can:
[a] Ctrl-drag the event in P thereby having Vegas adjusting the timing of C in P
[b] Change the timing in C directly.Which is better? If [b], is there a script that can be run so that I could specify (e.g.) 97% or 105% (where 97 would mean adjust the elements in C so that they play in 97% of their original time).
Thanks in advance.
John Rofrano replied 16 years, 9 months ago 3 Members · 6 Replies -
6 Replies
-
Mike Kujbida
August 3, 2009 at 12:43 amSince C has several tracks, etc., I think option [a] would be easier.
Figure out where the 97% point is, drop a marker a that spot and Ctrl-drag back to it. -
John Rofrano
August 3, 2009 at 12:51 amI agree with Mike. Since it’s already a nested project, I would just Ctrl+Drag the event in the parent project. This is the easiest thing to do and should provide the same results as if you had painstakingly adjusted everything in the original project. I don’t know if you are familiar with After Effects but nested projects in Vegas are like nested comps in AE. They are very useful for globally affecting everything in a project.
~jr
http://www.johnrofrano.com
http://www.vasst.com -
Tyson Onaga
August 3, 2009 at 4:45 pmOK got it.
However … I have run into a situation where I’d like to “re-space” Track Motion events. I need to do this in the original Vegas project. I.e., is there a Script that can take a Track’s Track Motion events and adjust them by X percent. E.g., all the events play in 60 seconds … I’d like it to be 80 seconds … so a factor 1.333.
This would be a tremendous time saver; else, it is the brute-force method. Thanks again.
-
John Rofrano
August 3, 2009 at 6:53 pmThere is no script that I know of that does this so I wrote one for you. Just change the percentage to whatever you want. I set it to 1.333 since that’s what you need now (sorry this forum messes up the original indentation):
/**
* Program: AdjustTrackMotion.cs
* Description: This script will adjust Track Motion data by a decimal percentage value
* Value greater than 1 will increase the distance between keyframes (e.g., 1.2 = 120%)
* Values less that 1 will decrease the keyframes (e.g., 0.8 = 80%)
* Copyright: (c) 2009 Sundance Media Group / VASST
* Author: John Rofrano
*
* Revision Date: August 3, 2009
**/using System;
using System.Collections;
using System.Windows.Forms;
using Sony.Vegas;class EntryPoint
{
// change this to whatever percentage you want to change the keyframes
private double percentage = 1.333;public void FromVegas(Vegas vegas)
{
try
{
VideoTrack videoTrack = FindSelectedVideoTrack(vegas);
if (videoTrack == null)
{
throw new ApplicationException("You must select a video track.");
}if (!videoTrack.TrackMotion.HasMotionData)
{
throw new ApplicationException("The track you selected has no motion keyframes.");
}ArrayList keyframes = new ArrayList(videoTrack.TrackMotion.MotionKeyframes);
foreach (TrackMotionKeyframe key in keyframes)
{
key.Position = new Timecode(key.Position.ToMilliseconds() * percentage);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Adjust Track Motion - Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}///
/// Returns the first selected video track or null of no video track is selected
///
VideoTrack FindSelectedVideoTrack(Vegas vegas)
{
foreach (Track track in vegas.Project.Tracks)
{
// look for a selected video track
if (track.IsVideo() && track.Selected)
{
return (VideoTrack)track;
}
}return null;
}}
~jr
http://www.johnrofrano.com
http://www.vasst.com -
Tyson Onaga
August 4, 2009 at 2:31 pmJohn,
Got to try this last night. Worked great! Thanks!
– Tyson -
John Rofrano
August 4, 2009 at 2:37 pm
Reply to this Discussion! Login or Sign Up