Comments

JohnnyRoy wrote on 5/11/2008, 4:14 AM
You should get the Vegas Pro 8.0 Script Developers Kit. Example 2.7 shows how to apply Event Pan/Crop. This can only be applied to an event not a track. It is not trivial as it involves using the events VideoMotion property, and setting the VideoMotionKeyframes using a VideoMotionVertex. All calculations are relative to the project resolution. It does have MoveBy and ScaleBy methods which make it a bit easier.

Here is the example I am referring to:

The following function moves a video event into view from a position off screen over a two second period.

void PanFromLeft(Vegas vegas, VideoEvent videoEvent)
{
// create a new keyframe at 2 seconds.
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 = vegas.Project.Video.Width;
// move the first keyframe just off screen
key0.MoveBy(new VideoMotionVertex(videoWidth, 0));
}

It is best to write a little sample script that you can change and see the effects in Vegas. This is how I learned how to use it; just by observing the behavior of different values.

~jr
johnmeyer wrote on 5/11/2008, 8:22 AM
Did you look at the pan/crop script I posted just a few days ago (it's right here in this forum about two lines down from this post, as of today)? It should definitely get you started.
Chethu wrote on 5/11/2008, 11:51 AM
Thanks JohnnyRoy , johnmeyer for your response.
Let me elaborate what I am looking for

In Vegas I created new project and clicked Video Event Pan Crop.
At different key frames I moved position of video, also rotated video
(Changed angle) and stored them as preset (Vegas provides this feature)
Also I selected Mask check box and using the “Anchor Creation
Tool” I selected required area from video and saved this as Preset.

I would like to use these preset for new projects and would like to write small
Script so that whenever I run this script it will apply these preset to Video event.

Any advice
Thanks
Chethu
jetdv wrote on 5/11/2008, 12:16 PM
Your script will need to add the movements you made in your presets. The script can do both the movements and the rotations. You'll just have to do them via script instead of via presets.