Here's a quick list of some of the changes to scripting in Vegas 5.
* Changed namespace from SonicFoundry.Vegas to Sony.Vegas. Almost all
Vegas 4 scripts will be broken but the fix is typically simply to
change the namespace import statement at the top of the script.
* New "Script Menu" folder (located in the Vegas 5 install dir)
contains the scripts you want to appear in Vegas' Tools.Scripting
sub-menu. Now you can have more than 10 scripts in the script menu
and you can organize them hierarchically by adding sub-folders to
the "Script Menu" folder. Menu scripts can still be added to the
toolbar.
* Custom toolbar and script menu icons: just place a 16X16 PNG image
with the same name as the script + '.png' in the "Script Menu"
folder. For example:
MyScript.js ==> your script
MyScript.js.png ==> your script's custom icon.
* New RenderArgs class allows you to set the same render parameters
that are available in the "Render As" dialog. A new version of the
Vegas.Render method accepts a single argument of type RenderArgs.
* System.Xml assembly is now loaded by default. If you want to use XML
classes, you'll still need to add the import statement(s) to the top
of your script but you won't need to use a script config file to
load the XML assembly.
* Script configuration files now should be named like this:
MyScript.js ==> your script
MyScript.js.config ==> your script's configuration file (still in xml format).
* Script config now available in global variable named
"ScriptSettings" as System.XmlDocument. This is a good way to pass
arguments into your script and save script settings.
* New static Timecode constructor methods including the native "nanos"
(actually units of 100 nanoseconds). Using these methods instead of
the normal Timecode constructors can help alleviate some errors
based on data type conversion. Some examples:
var t1 = Timecode.FromNanos(100000000);
var t2 = Timecode.FromMilliseconds(10000);
var t3 = Timecode.FromSeconds(10);
var t4 = Timecode.FromString("00:00:10:00");
var t5 = Timecode.FromFrames(10); // depends on project's ruler format
* PlugInNode.Presets collection allows you to enumerate the presets of
a plug-in without having to first add an effect to a track or event.
* Better support for offline media: You can create offline media in a
script by constructing a media object with a non-existing (but
otherwise valid) path. Then you can use Vegas & VidCap's "Recapture
Offline Media" functionality to actually capture the media. But
first you must set its TapeName, set its TimecodeIn, set its
TimecodeOut, and call the new CreateOfflineStream method.
* New Subclip class (subclass of Media) allows you to create and
manipulate subclips via script.
* Misc. tweaks and additions... I'll post the location of the new
Vegas Scripting SDK which includes the docs and FAQ when it becomes
available on our web site later this week.