Forum Replies Created
-
i just wanted to say thanks to both of you for trying to sort this out… my original project that i wanted the script for is now finished, i cutup all my bits of video manually…
but another project coming up will need exactly the same script so i do appreciate the help…
ta x
-
the same talented brother of mine gave me this version 2 of his script, helping me with naming and putting the subclips in a specific folder…
the trouble is, these scripts make something odd happen to vegas, occasionally the script won’t finish and vegas will tell me an exception has occurred,
then i try and load the same file (saved after i had done a script or 2) and it won’t load…
gets to 85%, 90%, or 94% and fails, “an exception has occurred” again…
so clearly there’s something not right with my brothers scripts, (and it is his 1st time writing them), i know it’s a lot to ask, but does anything strike anyone in the code?
thanks again x
/**
* You can use this script to convert Vegas regions to subclips. It will only work with saved projects.
*
* To use this script:
*
* 1) Create named Vegas regions.
* 2) Confirm no overlapped regions.
* 3) Vegas>tools>scripting>run script>Convert Regions To Subclips.cs
* 4) Check Project Media to see the subclips
*
* Revision Date: June 22, 2008.
**/
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.Windows.Forms;
using System.Globalization;
using Sony.Vegas;
public class EntryPoint
{
Vegas myVegas;
public void FromVegas(Vegas vegas) {
myVegas = vegas;
String projName;
String projFile = myVegas.Project.FilePath;
if ((null == projFile) || (String.Empty == projFile)) {
projName = “Untitled”;
} else {
projName = Path.GetFileNameWithoutExtension(projFile);
}
ConvertRegionsToSubclips();
}
void ConvertRegionsToSubclips() {
try {
/* foreach (Media media in myVegas.Project.MediaPool)
{
foreach (Region region in media.Regions)
{
//MessageBox.Show(media.FilePath);
//MessageBox.Show(region.Label);
Subclip subclip = new Subclip(myVegas.Project.FilePath, region.Position, region.Length, false, region.Label);
}
}*/
if (myVegas.Project.FilePath.Equals(“”))
MessageBox.Show(“Please save project before running this script”);
else
{
MediaBin InOrderBin = myVegas.Project.MediaPool.RootMediaBin;
bool foundIt = false;
foreach (MediaBin bin in myVegas.Project.MediaPool.RootMediaBin)
{
if (bin.Name.Equals(“in order”))
{
InOrderBin = bin;
foundIt = true;
}
}
if (foundIt)
{
String suffix = “”;
foreach (Region region in myVegas.Project.Regions)
{
//MessageBox.Show(myVegas.Project.FilePath);
//MessageBox.Show(region.Label);
String subclipLabel;
if (suffix.Equals(“”))
{
subclipLabel = region.Label;
suffix = region.Label.Substring(1);
}
else
subclipLabel = region.Label + suffix;
Subclip subclip = new Subclip(myVegas.Project.FilePath, region.Position, region.Length, false, subclipLabel);
InOrderBin.Add(subclip);
}
}
else
{
MessageBox.Show(“Cannot find media bin \”in order\””);
}
}
} finally {
}
}
}
-
i am fortunate to have a brother who is a computer programmer…
he wrote a script exactly as you described, his 1st, so a tiny bit buggy… if i can attach it as a txt file to this post i will (it would need to be renamed as a .cs file to be used as a script)…
thanks again for your help x
– as i can’t see where i can attach the .TXT file i’ll just cut & paste it here:
public class EntryPoint
{
Vegas myVegas;public void FromVegas(Vegas vegas) {
myVegas = vegas;String projName;
String projFile = myVegas.Project.FilePath;
if ((null == projFile) || (String.Empty == projFile)) {
projName = “Untitled”;
} else {
projName = Path.GetFileNameWithoutExtension(projFile);
}ConvertRegionsToSubclips();
}void ConvertRegionsToSubclips() {
try {
/* foreach (Media media in myVegas.Project.MediaPool)
{
foreach (Region region in media.Regions)
{
//MessageBox.Show(media.FilePath);
//MessageBox.Show(region.Label);
Subclip subclip = new Subclip(myVegas.Project.FilePath, region.Position, region.Length, false, region.Label);
}
}*/
foreach (Region region in myVegas.Project.Regions) {
//MessageBox.Show(myVegas.Project.FilePath);
//MessageBox.Show(region.Label);
Subclip subclip = new Subclip(myVegas.Project.FilePath, region.Position, region.Length, false, region.Label);
}
} finally {
}
}
} -
thanks again, i’ve got excalibur (version 5.5 because i’m running vegas 7) & i’m in the 15 day period before i have to pay money, (which i can’t afford to do just yet)…
for this current project i want to have different amounts of fade… but for many projects a set fade amount would be quite acceptable,
for what i do, partly because excalibur is a little pricey (for me) i’m more likely to find/create a few set scripts that deal with my obscure needs,
but then maybe i’ll find i can’t live without excalibur in the next 15 days and i’ll find the money somewhere for it..?
anyway, it’s going to take me awhile to learn how to create scripts, in the meantime, i need a script that puts 4 nodes into the velocity envelope bringing the velocity down to 99% for one second every 1 minute 24 seconds,
maybe it’s a good little project to learn how to create scripts with, or maybe someone has a similar script that i could change up a little?
thanks again for your help x
-
thanks, i’ll check that out, it would be most helpful, and would save me hours…
to be more exacting, i would also like to control the amount of fading on either side of each subclip, which means that regions wouldn’t have exact edges, one region (representing 1 subclip) would bleed a little (by a frame or as much as 3 frames) into the next region,
could scripting deal with this also?
x