? on editing the GUI batch render script

Erk wrote on 4/20/2004, 4:50 PM
I'm working with John Meyer's (JHM) Batch Render GUI, and it is wonderful.

The slight change I'd like to make is to simplify the rendered file names that get generated. I would like to skip everything that gets appended (directory name, padded zeros, separator character) and just take the file name straight from the region name.

I've been trying to edit it myself, but I can't seem to correctly comment out or otherwise change the correct elements.

Many thanks for your help,

Greg

Comments

johnmeyer wrote on 4/21/2004, 12:22 AM
I actually didn't write the script, but rather modified an existing script. One of the things I added was the ability to have the file name be a concatenation of those various names.

The "regionFilename" is the term you need to search on to find how the file name gets built up. If you select Regions, the initial part of the file name gets created here:
var regionFilename = new StringBuilder(filename);
If you don't want to start with the file name, you can just insert a text string instead, e.g.,
var regionFilename = "MyMasterpiece";
If you don't want to start with any particular file name, then assign a blank string, i.e.:
var regionFilename = "";
The lines immediately below this line add to the file name:
// Pad index number with leading zeros
regionIndex = ( regionIndex < 10 ) ? "0" + regionIndex : regionIndex;
regionFilename.Append(regionIndex);
regionFilename.Append("_");
regionFilename.Append(region.Label);
If you just want to use the region name, then all you need is the last line, and you can delete the previous three lines.

Note, however, that it will be up to you to flag any errors that the script may then create. In particular, Vegas lets you assign identical names to different regions. If you then use one of these duplicate regions as a file name, I am sure that the script will terminate in some way or another. One of the advantages to using the region index number is that it ensures that each file name will be unique, even when the region name is a duplicate. Also, it makes it easy to sort the regions based on their position on the timeline.

Hope this helps!
Erk wrote on 4/21/2004, 6:13 PM
Thanks John, I think I can make it work now. I'm grateful for the explanation.

Greg
johnmeyer wrote on 4/22/2004, 12:06 PM
You're welcome!