Error when trying to add VideoMotionKeyframe

egezx wrote on 6/25/2017, 7:05 AM

I am using example code from scripting FAQ:

                VideoMotionKeyframe key1 = new VideoMotionKeyframe(Timecode.FromSeconds(2));
                // add the new keyframe
                videoEvent.VideoMotion.Keyframes.Add(key1);
                // get the first keyframe
                VideoMotionKeyframe key0 = videoEvent.VideoMotion.Keyframes[0];
                // get the width of the project
                int videoWidth = myVegas.Project.Video.Width;
                // move the first keyframe just off screen
                key0.MoveBy(new VideoMotionVertex(videoWidth, 0));

For some reason it is just not working. I surrounded that code with try catch and received "Catacstrophic failure" exception. This error occurs in line "videoEvent.VideoMotion.Keyframes.Add(key1);"

I am able to for example read current count of keyframes "videoEvent.VideoMotion.Keyframes.Count" so atleast that videoEvent class should be fine.

What could be wrong?

 

Comments

No comments yet - be the first to write a comment...