Hey, I'm getting this error when trying to set the bounds on a keyframe: "Failed to set bounds. One or more vertices invalid."
As you can see I'm not even editing the bounds and I'm still getting this error:
foreach (Track track in myVegas.Project.Tracks)
{
if (track.IsVideo())
{
foreach (TrackEvent trackEvent in track.Events)
{
VideoEvent videoEvent = (VideoEvent)trackEvent;
VideoMotionKeyframes videoKeyframes = videoEvent.VideoMotion.Keyframes;
VideoMotionKeyframe keyframe = videoKeyframes[0];
VideoMotionBounds bounds = keyframe.Bounds;
keyframe.Bounds = bounds;
}
}
}
I also tried to change the bounds like so:
foreach (Track track in myVegas.Project.Tracks)
{
if (track.IsVideo())
{
foreach (TrackEvent trackEvent in track.Events)
{
VideoEvent videoEvent = (VideoEvent)trackEvent;
VideoMotionKeyframes videoKeyframes = videoEvent.VideoMotion.Keyframes;
VideoMotionKeyframe keyframe = videoKeyframes[0];
VideoMotionBounds bounds = keyframe.Bounds;
bounds.TopLeft = new VideoMotionVertex(0, 0);
bounds.TopRight = new VideoMotionVertex(100, 0);
bounds.BottomLeft = new VideoMotionVertex(0, 100);
bounds.BottomRight = new VideoMotionVertex(100, 100);
keyframe.Bounds = bounds;
}
}
}
but it doesn't work either. The error occurs at the following line: "keyframe.Bounds = bounds;"
Anyone knows why?
