Learning lots about Vegas the past few months, including BATCH rendering.
However, I do have a question:
How can I add render region loops all at once, rather than highlighting and adding the letter "R" to 100 clips manually prior to batch rendering via the scripting menu?
This question would fit better in the Scripting forum. The solution will likely involve changing the loop region via modifying the Vegas.SelectionStart and Vegas.SelectionLength properties in a for-loop and then invoking a render with a generated filename.
Something roughly like this, if I've understood your goal correctly:
RenderArgs renderArgs = new RenderArgs();
renderArgs.UseSelection = true;
// TODO: configure the render with the right template
long totalFrames = vegas.Project.Length.FrameCount;
long stepFrames = ProjectTimecode.FromSeconds(vegas.Project, 300).FrameCount; // five minutes per render
for (int i = 0; i * stepFrames < totalFrames; ++i)
{
long startFrame = i * stepFrames;
long renderLength = Math.Min(stepFrames, totalFrames - startFrame);
vegas.SelectionStart = ProjectTimecode.FromFrames(vegas.Project, startFrame);
vegas.SelectionLength = ProjectTimecode.FromFrames(vegas.Project, renderLength);
renderArgs.OutputFile = "C:\\Render\\R" + i + ".mp4";
vegas.Render(renderArgs);
}
I found this script by John Rofrano. I know it works on Pro 10 32 bit. Hope it helps.
Mike
/**
* Program: RegionsAtEvents.cs
* Author: John Rofrano
* Purpose: This script will place a region at each event on the selected track(s)
* Copyright: (c) 2010, Sundance Media Group / VASST
* Updated: February 27, 2010
**/
using System;
using System.Windows.Forms;
using Sony.Vegas;
class EntryPoint
{
public void FromVegas(Vegas vegas)
{
foreach (Track track in vegas.Project.Tracks)
{
// only process selected tracks
if (!track.Selected) continue;
foreach (TrackEvent trackEvent in track.Events)
{
Region region = new Region(trackEvent.Start, trackEvent.Length, trackEvent.ActiveTake.Name);
try
{
vegas.Project.Regions.Add(region);
}
catch (Exception e)
{
MessageBox.Show(String.Format("Could not place a region at {0}\nError message is: {1}", trackEvent.Start.ToString(), e.Message), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
}
}