Here's what is new in Vegas 6.0a for scripting. The new API docs can
be found here.
* Scripts now run in their own app domain which is loaded and unloaded
each time a script is run. This allows referenced assemblies to be
recompiled without restarting Vegas and fixes various problems.
* Vegas now supports CodeDom compilers. This allows scripts to be
written in C# as well as JScript and VB. Vegas also now supports
precompiled scripts which can be written in any CLR language.
Precompiled script have better performance by allowing Vegas to
bypass compilation each time the script is run. By default, JScript
and VB still use the VSA script engines but they can be converted to
CodeDOM by adding the following element to their script config
files:
<UseCodeDomCompiler>true</UseCodeDomCompiler>
CodeDom and precompiled scripts require an entry point that Vegas
calls to begin execution. By default, this is a class named
"EntryPoint" with a method named "FromVegas:. Here is a sample C#
script:
using System;
using System.Windows.Forms;
using Sony.Vegas;
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
MessageBox.Show(vegas.Version);
}
}
The EntryPoint class is defined in the top level namespace (not
within any namespace statements). The FromVegas method can have a
variety of arguments. Here are the options:
public void FromVegas(Vegas vegas)
public void FromVegas(Vegas vegas, String scriptFile)
public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings)
public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings, ScriptArgs args)
Vegas will call the version with the greatest number of arguments.
It is possible to use a different class for your entry point by
specifying the class name in your script config file. For example,
the following element will instruct Vegas to create an instance of
the class named MyClass declared in the namespace MyNamespace and
call its FromVegas method:
<MainClass>MyNamespace.MyClass</MainClass>
* Shortcuts (.lnk files) located in the script menu directory can be
used invoke scripts located in another directory. Shortcuts can
also be used to specify ScriptArg values which are passed to the
script as an entry point method parameter for CodeDom and
precompiled scripts or as a global variable named "ScriptArgList"
for VSA scripts. To specify ScriptArgs in a shortcut file, first
right-click on the shortcut and select Properties. The Target field
of the Shortcut tab in the properties dialog will contain the path
to your script. After the path, you can append script arguments as
name/value pairs. For example, in the shortcut target field,
specify the following:
C:\Vegas Scripts\TestScript.cs msgEN=hello world&msgES=hola mundo
Make sure there is a space between the script path and the first
script argument. Argument names and values are separated by the '='
character and additional pairs are separated by the '&' character.
Below in an example of the reading argument values from the
ScriptArgs object:
public class EntryPoint
{
public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings, ScriptArgs args)
{
MessageBox.Show(args.ValueOf("msgEN", false));
MessageBox.Show(args.ValueOf("msgSP", false));
}
}
See the scripting API documentation for more details on using the
ScriptArgs class. Icons for shortcuts in the script menu should be
named similarly to how they're named for scripts. For example, if
your shortcut is named "MyScript.lnk", its icon should be named
"MyScript.lnk.png".
* Video track compositing properties:
VideoTrack.CompositeLevel
VideoTrack.CompositeMode
VideoTrack.CompositeModeEffect
VideoTrack.ParentCompositeMode
VideoTrack.ParentCompositeModeEffect
VideoTrack.CompositeNestingLevel
VideoTrack.IsCompositingChild
VideoTrack.IsCompositingParent
* Event sync properties and methods:
TrackEvent.SyncOffset
TrackEvent.SyncEvent
TrackEvent.SyncByMove()
TrackEvent.SyncByMove()
TrackEvent.SyncBySlip()
* Equals method and equality operators (== and !=) are now overridden
for the following classes:
Track
AudioTrack
VideoTrack
TrackEvent
AudioTrackEvent
VideoTrackEvent
BusTrack
AudioBusTrack
VideoBusTrack
Envelope
EnvelopePoint
Marker
Region
CDMarker
CDRegion
CommandMarker
Media
Subclip
Take
Timecode
TrackEventGroup
be found here.
* Scripts now run in their own app domain which is loaded and unloaded
each time a script is run. This allows referenced assemblies to be
recompiled without restarting Vegas and fixes various problems.
* Vegas now supports CodeDom compilers. This allows scripts to be
written in C# as well as JScript and VB. Vegas also now supports
precompiled scripts which can be written in any CLR language.
Precompiled script have better performance by allowing Vegas to
bypass compilation each time the script is run. By default, JScript
and VB still use the VSA script engines but they can be converted to
CodeDOM by adding the following element to their script config
files:
<UseCodeDomCompiler>true</UseCodeDomCompiler>
CodeDom and precompiled scripts require an entry point that Vegas
calls to begin execution. By default, this is a class named
"EntryPoint" with a method named "FromVegas:. Here is a sample C#
script:
using System;
using System.Windows.Forms;
using Sony.Vegas;
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
MessageBox.Show(vegas.Version);
}
}
The EntryPoint class is defined in the top level namespace (not
within any namespace statements). The FromVegas method can have a
variety of arguments. Here are the options:
public void FromVegas(Vegas vegas)
public void FromVegas(Vegas vegas, String scriptFile)
public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings)
public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings, ScriptArgs args)
Vegas will call the version with the greatest number of arguments.
It is possible to use a different class for your entry point by
specifying the class name in your script config file. For example,
the following element will instruct Vegas to create an instance of
the class named MyClass declared in the namespace MyNamespace and
call its FromVegas method:
<MainClass>MyNamespace.MyClass</MainClass>
* Shortcuts (.lnk files) located in the script menu directory can be
used invoke scripts located in another directory. Shortcuts can
also be used to specify ScriptArg values which are passed to the
script as an entry point method parameter for CodeDom and
precompiled scripts or as a global variable named "ScriptArgList"
for VSA scripts. To specify ScriptArgs in a shortcut file, first
right-click on the shortcut and select Properties. The Target field
of the Shortcut tab in the properties dialog will contain the path
to your script. After the path, you can append script arguments as
name/value pairs. For example, in the shortcut target field,
specify the following:
C:\Vegas Scripts\TestScript.cs msgEN=hello world&msgES=hola mundo
Make sure there is a space between the script path and the first
script argument. Argument names and values are separated by the '='
character and additional pairs are separated by the '&' character.
Below in an example of the reading argument values from the
ScriptArgs object:
public class EntryPoint
{
public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings, ScriptArgs args)
{
MessageBox.Show(args.ValueOf("msgEN", false));
MessageBox.Show(args.ValueOf("msgSP", false));
}
}
See the scripting API documentation for more details on using the
ScriptArgs class. Icons for shortcuts in the script menu should be
named similarly to how they're named for scripts. For example, if
your shortcut is named "MyScript.lnk", its icon should be named
"MyScript.lnk.png".
* Video track compositing properties:
VideoTrack.CompositeLevel
VideoTrack.CompositeMode
VideoTrack.CompositeModeEffect
VideoTrack.ParentCompositeMode
VideoTrack.ParentCompositeModeEffect
VideoTrack.CompositeNestingLevel
VideoTrack.IsCompositingChild
VideoTrack.IsCompositingParent
* Event sync properties and methods:
TrackEvent.SyncOffset
TrackEvent.SyncEvent
TrackEvent.SyncByMove()
TrackEvent.SyncByMove()
TrackEvent.SyncBySlip()
* Equals method and equality operators (== and !=) are now overridden
for the following classes:
Track
AudioTrack
VideoTrack
TrackEvent
AudioTrackEvent
VideoTrackEvent
BusTrack
AudioBusTrack
VideoBusTrack
Envelope
EnvelopePoint
Marker
Region
CDMarker
CDRegion
CommandMarker
Media
Subclip
Take
Timecode
TrackEventGroup