using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;
namespace Test_Script
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
foreach(Track myTrack in myVegas.Project.Tracks)
{
if (myTrack.IsVideo())
{
foreach(VideoEvent evnt in myTrack.Events)
{
if (evnt.Selected)
{
string plugInUID = "{Svfx:de.magix:Stabilize}";
PlugInNode fx = myVegas.VideoFX;
PlugInNode plugin = fx.GetChildByUniqueID(plugInUID);
Effect effect = new Effect(plugin);
evnt.Effects.Add(effect);
OFXEffect ofx = effect.OFXEffect;
OFXChoiceParameter X = (OFXChoiceParameter)ofx["Views"];
X.Value = X.Choices[2];
X.ParameterChanged();
evnt.OpenVideoEffectUI();
}
}
}
}
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;
namespace Test_Script
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
foreach (Track myTrack in myVegas.Project.Tracks)
{
if (myTrack.IsVideo())
{
foreach (VideoEvent evnt in myTrack.Events)
{
if (evnt.Selected)
{
string plugInUID = "{Svfx:de.magix:Stabilize}";
PlugInNode fx = myVegas.VideoFX;
PlugInNode plugin = fx.GetChildByUniqueID(plugInUID);
Effect effect = new Effect(plugin);
evnt.Effects.Add(effect);
OFXEffect ofx = effect.OFXEffect;
OFXChoiceParameter X = (OFXChoiceParameter)ofx["Views"];
X.Value = X.Choices[2];
X.ParameterChanged();
evnt.OpenVideoEffectUI();
foreach (OFXParameter parm in ofx.Parameters)
{
if (parm.ParameterType.ToString() == "PushButton" && parm.Name == "AnalyzeMotion")
{
parm.ParameterChanged();
}
}
}
}
}
}
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}
Please, If i want to add in this script bellow the Preset "Black" from media generator solid color and add an videoFX effect plugin Brightness and contrast?
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using ScriptPortal.Vegas;
namespace Test_Script
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
//Add Media Generate Solid Color to the first track
Track mytrack = myVegas.Project.Tracks[0];
string genUID = "{Svfx:com.vegascreativesoftware:solidcolor}";
PlugInNode plugIn = null;
plugIn = myVegas.Generators.GetChildByUniqueID(genUID);
Media media = new Media(plugIn);
MediaStream stream = media.Streams.GetItemByMediaType(MediaType.Video, 0);
VideoEvent newEvent = new VideoEvent(myVegas.Transport.CursorPosition, Timecode.FromSeconds(15));
mytrack.Events.Add(newEvent);
Take take = new Take(stream);
newEvent.Takes.Add(take);
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}
@Steve_Rhoden There is a post where @marcinzm talks about of a possible way to do the push button analyse automatically, i don't know if works, because i don't have Prodad Mercalli V5;
However after the installation, you have to copy all its folders from the default ofx plugins location to the Vegas Pro OFX Video Plugins folder, for Vegas to recognize it.
@Steve_Rhoden, I don't like installing unwanted/unneeded software onto my system. But I would think this script would work just fine there as well by changing the information related to which plugin to add and the name of the button to press. Naturally, I'd take out the three lines that changes the "Views" as well as that also won't apply but I don't know if there's something similar that might need to be changed in Prodad before pushing the button. The Prodad script shown above looks a lot more complicated (and I can't read the message contents) so it might work the first time if simplified... In other words, you might just try this:
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;
namespace Test_Script
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
foreach (Track myTrack in myVegas.Project.Tracks)
{
if (myTrack.IsVideo())
{
foreach (VideoEvent evnt in myTrack.Events)
{
if (evnt.Selected)
{
string plugInUID = "{Svfx:com.proDAD:StabilizerV4}";
PlugInNode fx = myVegas.VideoFX;
PlugInNode plugin = fx.GetChildByUniqueID(plugInUID);
Effect effect = new Effect(plugin);
evnt.Effects.Add(effect);
OFXEffect ofx = effect.OFXEffect;
evnt.OpenVideoEffectUI();
foreach (OFXParameter parm in ofx.Parameters)
{
if (parm.ParameterType.ToString() == "PushButton" && ofxparm.Label == "Analyze")
{
parm.ParameterChanged();
}
}
}
}
}
}
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}
However after the installation, you have to copy all its folders from the default ofx plugins location to the Vegas Pro OFX Video Plugins folder, for Vegas to recognize it.
And, since the day you mentioned that Plugin, I was trying to find a solution for it. So, today I finally got it. Now, the Prodad Mercalli V5 plugin works as the same as the final script of Vegas Video Stabilization OFX plugin made by @jetdv.
Here's the code, Have fun;
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;
namespace Test_Script
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
foreach (Track myTrack in myVegas.Project.Tracks)
{
if (myTrack.IsVideo())
{
foreach (VideoEvent evnt in myTrack.Events)
{
if (evnt.Selected)
{
string plugInUID = "{Svfx:com.proDAD:StabilizerV4}";
PlugInNode fx = myVegas.VideoFX;
PlugInNode plugin = fx.GetChildByUniqueID(plugInUID);
Effect effect = new Effect(plugin);
evnt.Effects.Add(effect);
OFXEffect ofx = effect.OFXEffect;
evnt.OpenVideoEffectUI();
foreach (OFXParameter parm in ofx.Parameters)
{
if (parm.ParameterType.ToString() == "PushButton" && parm.Name == "AnalysisParam")
{
parm.ParameterChanged();
}
}
}
}
}
}
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}