Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro Not working – Region text to be the file name in a batch render

  • Not working – Region text to be the file name in a batch render

    Posted by Craig Scime on January 19, 2008 at 8:43 pm

    I have been spending hours and racking my brain, trying to get the region text, and only the region text to show as the file name for a batch render, for each rendered file.

    I have read all the posts here and on sony’s site about this, but nothing sugested works. I am running vegas 7 and every time I try modifing the scripts i am only left with errors.

    Beleive me I have wasted way to much time on this, but if I can get it to work it would really be great as I edit 15 samll clips for my client regularly and put a differt title in each region, then batch render all the clips.

    Also if their is a program that will do this too I would consider that too, but if it is easy as a script, or if you have the script, I would love to share it.

    thanks Craig

    Daniel Payne replied 15 years, 2 months ago 6 Members · 18 Replies
  • 18 Replies
  • Edward Troxel

    January 19, 2008 at 11:41 pm

    If you’re rendering regions, you should see a line of code like this:

    String regionFilename = String.Format(“{0}[{1}]{2}”,
    filename,
    regionIndex.ToString(),
    renderItem.Extension);

    At this point, you should get a filename which begins with a base filename plus the region number. Instead, you want to combine the PATH of the filename plus the NAME of the region which could be done like this:

    String regionFilename = String.Format(“{0}\\{1}{2}”,
    Path.GetDirectory(filename),
    region.Label,
    renderItem.Extension);

    The above will take the path of the base filename, add the necessary backslash, and then add the label of the region name. See if this works for you.

    Edward Troxel
    JETDV Scripts

  • Craig Scime

    January 21, 2008 at 11:29 pm

    Thanks ed for trying to help but I am still not have any luck. I went into the program files in vegas, then script menu, made a copy of the batch render file (so I would not ruin the working file), then I copied the text as you had, but as soon as I click on file under scripting in vegas i get an error this is what I have, I have even kept it lined up like it was under the “, (can’t show exactly below due to space:
    // need to strip off the extension’s leading “*”
    String regionFilename = String.Format(“{0}[{1}]{2}”,
    Path.GetDirectory(filename),
    region.Label,
    renderItem.Extension);
    // Render the region

    WHat am I doing wrong??????

  • Edward Troxel

    January 22, 2008 at 2:49 pm

    [craig scime] “String.Format(“{0}[{1}]{2}”,”

    You didn’t change this as I indicated. Get rid of the square brackets [ and ] and add two back-slashes between {0} and {1} “\”. I noticed my above post got reduced to a single backslash but there should be two.

    Edward Troxel
    JETDV Scripts

  • Craig Scime

    January 22, 2008 at 4:46 pm

    thank you ed for you time and patience, however i am still not having any luck, and I thought I was very good with this stuff. I am getting this error:
    C:\Program Files\Sony\Vegas 7.0\Script Menu\Copy of Batch Render.cs(93) : ‘System.IO.Path’ does not contain a definition for ‘GetDirectory’

    C:\Program Files\Sony\Vegas 7.0\Script Menu\Copy of Batch Render.cs(95) : ‘EntryPoint.RenderItem’ does not contain a definition for ‘Extension’

    …and here is what i have in the script

    String regionFilename = String.Format(“{0}\\{1}{2}”,
    Path.GetDirectory(filename),
    region.Label,
    renderItem.Extension);

  • Edward Troxel

    January 22, 2008 at 5:05 pm

    Sorry, it’s GetDirectoryName

    Edward Troxel
    JETDV Scripts

  • Craig Scime

    January 22, 2008 at 5:38 pm

    I must be a retard, ugh.
    Down to one error:

    C:\Program Files\Sony\Vegas 7.0\Script Menu\Copy of Batch Render.cs(95) : ‘EntryPoint.RenderItem’ does not contain a definition for ‘Extension’

    this is what I currently have:
    String regionFilename = String.Format(“{0}\\{1}{2}”,
    Path.GetDirectoryName(filename),
    region.Label,
    renderItem.Extension);

  • Edward Troxel

    January 22, 2008 at 6:14 pm

    [craig scime] “MenuCopy of Batch Render.cs(95) : ‘EntryPoint.RenderItem’ does not contain a definition for ‘Extension'”

    WHAT is on line 96? In the original file, it is this:

    status = DoRender(regionFilename, renderItem, region.Position, region.Length);

    What is on YOUR line 96? It seems to be you might possibly have a capital “R” instead of a lowercase “r” on one of your “renderItem” variables?

    Edward Troxel
    JETDV Scripts

  • Craig Scime

    January 22, 2008 at 6:39 pm

    String regionFilename = String.Format(“{0}\\{1}{2}”,
    Path.GetDirectoryName(filename),
    region.Label,
    renderItem.Extension);
    // Render the region
    status = DoRender(regionFilename, renderItem, region.Position, region.Length);
    if (RenderStatus.Canceled == status) break;
    regionIndex++;

  • Craig Scime

    January 22, 2008 at 6:45 pm

    hi ed thank again… do you have the script or know where one is posted that works and does what I need it to do?

  • Edward Troxel

    January 22, 2008 at 7:21 pm

    Here it is:

    https://www.jetdv.com/scripts/BatchRender-Regions.cs

    It contains exactly the changes I gave you above. Just run it, pick the output type you want, pick a default folder (just leave the “untitled” file name – it will be ignored) and you’ll end up with a bunch of files in that folder – one named for each region name.

    Edward Troxel
    JETDV Scripts

Page 1 of 2

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