I'm trying to write a script that adds Text Command Markers to a project. I keep getting an error when I try to add the marker. I'm new to C# and vegas scripting, so I'm sure that I'm just doing something wrong, but I can't figure it out for the life of me.
Here's what I'm doing:
private void button1_Click(object sender, EventArgs e)
{
CommandMarkerList myClist = vegas.Project.CommandMarkers;
CommandMarker newMarker = new CommandMarker((Timecode.FromSeconds(0)), (new MarkerCommandType("Text")), "Test1", "Test");
myClist.Add(newMarker);
}
The error comes at the point where I try to add the newMarker to the CommandMarkerList. I didn't think I'd need this step, but just creating the newMarker doesn't seem to do anything. I'm guessing that I'm creating the marker incorrectly? Any help would be appreciated.
Here's what I'm doing:
private void button1_Click(object sender, EventArgs e)
{
CommandMarkerList myClist = vegas.Project.CommandMarkers;
CommandMarker newMarker = new CommandMarker((Timecode.FromSeconds(0)), (new MarkerCommandType("Text")), "Test1", "Test");
myClist.Add(newMarker);
}
The error comes at the point where I try to add the newMarker to the CommandMarkerList. I didn't think I'd need this step, but just creating the newMarker doesn't seem to do anything. I'm guessing that I'm creating the marker incorrectly? Any help would be appreciated.