Here's a simple test program I wrote to ensure that I can find and read in media markers. Unfortunately I'm not succeeding right now:
using System.Text;
using ScriptPortal.Vegas;
using System.Windows.Forms;namespace TEST
{
public class EntryPoint
{
public void FromVegas(Vegas vegas)
{
Project proj = vegas.Project;
StringBuilder s = new StringBuilder();
foreach (Track track in proj.Tracks)
{
foreach (TrackEvent trackEvent in track.Events)
{
Take activeTake = trackEvent.ActiveTake;
if (null == activeTake)
continue;
Media media = activeTake.Media;
if (null == media)
continue; foreach (MediaMarker mm in media.Markers)
{
s.Append(mm.Label.ToString());
}
}
}
MessageBox.Show(s.ToString());
}
}
}
I wrote it in Visual Studio 2019 on top of Vegas18Pro and followed the very helpful debugging steps from VEGASScriptFAQ.html to hit breakpoints. But despite having adding a media marker (manually - by hitting `M`), `media.Markers.length` is 0 for every trackEvent's activeTake's media object.
Is MediaMarker the concept I think it is or should I be reading these in differently?