-
macro?
Posted by Robbie Knight on June 17, 2008 at 12:20 ami use vegas 7,
sometimes i make cutup films, for example: here, here, here & here
i’m currently working on a cutup involving 104 different clips, each of 3 seconds, to be cut in a variety of different length subclips,
so i make subclips with the clips using the trimmer,
i would like to cut a clip in a certain way, save the way it’s cut (into let’s say 10 different subclips)
then cut another clip in exactly the same way, as if i recorded a macro (to use an excel term) the 1st time i did it and used that macro for the other times i needed it,
any clues?
thanks in advance x
Christine Neuvil replied 7 years, 4 months ago 4 Members · 8 Replies -
8 Replies
-
Edward Troxel
June 17, 2008 at 12:46 pmYou would need to use a script. Add a clip on the timeline, put regions where you wanted the sub-clips from, then create a script that would make one sub-clip for each region. Now replace the first clip with the next clip and run the script again to create sub-clips from each region. It would be much faster that way.
If you don’t want to write your own script, the “Extract Good Clips” tool in Excalibur could actually do this for you. Not sure if there’s any free scripts out there that does this particular task.
-
Robbie Knight
June 18, 2008 at 2:11 amthanks, 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
-
Edward Troxel
June 18, 2008 at 12:34 pm -
Robbie Knight
June 18, 2008 at 4:14 pmthanks 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
-
Robbie Knight
June 22, 2008 at 6:17 pmi 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 {
}
}
} -
Robbie Knight
June 22, 2008 at 9:35 pmthe 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 {
}
}
}
-
Jill Simpson
November 21, 2008 at 6:32 pmI partially solved the error.
I installed the script version 2, and I got an error, all due to line 171 of the script, which is:
MessageBox.Show(“Cannot find media bin “in order””);
The problem is the quotes around “in order”. I replaced them with apostrophes:
MessageBox.Show(“Cannot find media bin ‘in order'”);Before that change, the error details showed:
C:\Program Files (x86)\Sony\Vegas Pro 8.0\Script Menu\J – Convert Regions To Subclips.cs(171) : ) expected
(I think that means it got a close-parenthesis when it expected nothing.)
C:\Program Files (x86)\Sony\Vegas Pro 8.0\Script Menu\J – Convert Regions To Subclips.cs(171) : Invalid expression term ‘in’
C:\Program Files (x86)\Sony\Vegas Pro 8.0\Script Menu\J – Convert Regions To Subclips.cs(171) : ; expected
C:\Program Files (x86)\Sony\Vegas Pro 8.0\Script Menu\J – Convert Regions To Subclips.cs(171) : ; expected
C:\Program Files (x86)\Sony\Vegas Pro 8.0\Script Menu\J – Convert Regions To Subclips.cs(171) : ; expected
C:\Program Files (x86)\Sony\Vegas Pro 8.0\Script Menu\J – Convert Regions To Subclips.cs(171) : Invalid expression term ‘)’After changing the quote marks to parentheses, I got a simpler error: “cannot find bin ‘in order'”.
I could change the script to match one of my bins, but I created a bin ‘in order’, and saved the project.Then I ran the script and – oh darn – got the “Exception occurred” error, the details of which are:
Sony Vegas Pro 8.0
Version 8.0b (Build 217)
Exception 0xC0000005 (access violation) READ:0x2AC IP:0x77008D06
In Module ‘kernel32.dll’ at Address 0x76F60000 + 0xA8D06
Thread: GUI ID=0xF6C Stack=0x17E000-0x180000
Registers:
EAX=00000001 CS=0023 EIP=77008d06 EFLGS=00210297
EBX=00000000 SS=002b ESP=0017e6ec EBP=0017e768
ECX=00000000 DS=002b ESI=ffffffff FS=0053
EDX=000002ac ES=002b EDI=011eaa60 GS=002b
Bytes at CS:EIP:
77008D06: 0F B7 0A 8B 75 18 66 3B ….u.f;
77008D0E: 0E 6A 02 89 55 FC 89 75 .j..U..u
Stack Dump:
0017E6EC: 0D75B4AC 0D5A0000 + 1BB4AC
0017E6F0: 00000001
0017E6F4: 000002AC
0017E6F8: 00000000
0017E6FC: 00000000
0017E700: 00000000
0017E704: 000002AC
0017E708: 00000000
0017E70C: 00000000
0017E710: 00000002
0017E714: 5F009E34 5E880000 + 789E34
0017E718: 00000001
0017E71C: 00000000
0017E720: 00000000
0017E724: 00000000
0017E728: 00000000
> 0017E74C: 76F7151C 76F60000 + 1151C (kernel32.dll)
> 0017E764: 76FAB89B 76F60000 + 4B89B (kernel32.dll)
> 0017E76C: 76F7151C 76F60000 + 1151C (kernel32.dll)
> 0017E79C: 76F92AB7 76F60000 + 32AB7 (kernel32.dll)
> 0017E7C4: 00740539 00400000 + 340539 (vegas80.exe)
0017E7C8: 000002AC
0017E7CC: 0D75B4AC 0D5A0000 + 1BB4AC
0017E7D0: 313C8F08 305E0000 + DE8F08
0017E7D4: 4042C71C 401A0000 + 28C71C
> 0017E7E0: 00740701 00400000 + 340701 (vegas80.exe)
0017E7E4: 0017E81C 00080000 + FE81C
0017E7E8: 0017E810 00080000 + FE810
0017E7EC: 0017E7F8 00080000 + FE7F8
0017E7F0: 0017E8F8 00080000 + FE8F8
> 0017E7FC: 0073F922 00400000 + 33F922 (vegas80.exe)
0017E800: 0017E81C 00080000 + FE81C
0017E804: 0017E810 00080000 + FE810
0017E808: 0000001F
0017E80C: 8004E007
> 0017E818: 006E6D82 00400000 + 2E6D82 (vegas80.exe)
0017E81C: 000002AC
0017E820: 00360031 002E0000 + 80031
> 0017E824: 00770020 00400000 + 370020 (vegas80.exe)
> 0017E828: 006F0068 00400000 + 2F0068 (vegas80.exe)
– – –
0017FFF0: 00000000
0017FFF4: 0083F20B 00400000 + 43F20B (vegas80.exe)
0017FFF8: 7EFDE000 7EFDE000 + 0
0017FFFC: 00000000I don’t imagine that means anything to anyone (anywhere).
-
Christine Neuvil
January 8, 2019 at 11:03 amDid you ever get that script to work?
Did you ever find an alternate solution?
Did Jill Simpson’s finding that quotes (“in order”) needed to be replaced with apostrophes (‘in order’) help?
Anyone know if other video editing software allows batch render to subclips (a) if the timeline or trimmer contains a single source file? (b) if the timeline or trimmer contains multiple but separated source files (with each region from a single source file)? (I know you can’t create sub-clips from a region if the region combines multiple source files, aka clips.)
Thanks
Reply to this Discussion! Login or Sign Up
