@jetdv@zzzzzz9125 Please, could you help me to create a script that removes transitions from selected events. I've tried a lot of ways, but nothing works.
@Thiago_Sase Basically, take the script that I wrote to FIND transitions and modify it to look at only selected events and then remove them. This is a quick update to that script but I have not tested it.
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 vEvnt in myTrack.Events)
{
if (vEvnt.Selected)
{
RemoveAnyTransition(vEvnt.FadeIn);
RemoveAnyTransition(vEvnt.FadeOut);
}
}
}
}
}
public void RemoveAnyTransition(Fade fade)
{
object trans = fade.Transition;
if (trans != null)
{
fade.RemoveTransition();
}
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}
@jetdv Please sir, if you can help, I watched these tutorials;
How to get the list of effects: How to add an effect and pick a preset: Add Generated Media to the timeline:
But, I can't make it work picking the preset of the Media Generator as the same as an effect.
When i use the script the Media generator (legacy text) is added in the timeline but the Preset is not.
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using System.Windows.Forms;
using ScriptPortal.Vegas;
namespace Test_Script
{
public class Class1
{
public Vegas myVegas;
public void Main(Vegas vegas)
{
myVegas = vegas;
Track myTrack = myVegas.Project.Tracks[0];
string genUID = "{0FE8789D-0C47-442A-AFB0-0DAF97669317}";
int presetCount = 3;
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(10));
myTrack.Events.Add(newEvent);
Take take = new Take(stream);
newEvent.Takes.Add(take);
Effect effect = new Effect(plugIn);
newEvent.Effects.Add(effect);
effect.Preset = effect.Presets[presetCount].Name;
}
}
}
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Test_Script.Class1 test = new Test_Script.Class1();
test.Main(vegas);
}
}
The mistakes are in these lines?;
Effect effect = new Effect(plugIn);
newEvent.Effects.Add(effect);
effect.Preset = effect.Presets[presetCount].Name;
The script is about insert the media generator legacy text with the preset soft shadow or any other preset.