Accessing TrackMotion Class

2G wrote on 11/30/2008, 9:50 PM
I need to get to the TrackMotion class for the various tracks in a project. But I've looked in the documentation, and can't seem to find a reference to it. My first thought would be that it would be a property on the VideoTrack class. But there is no reference to TrackMotion on the VideoTrack class. Is that just an omission in the doc? If it is indeed the way, can I assume the property name is just "TrackMotion"? If there is a completely different way to access TrackMotion, can someone please give me a pointer?

Thanks.

2G

Comments

jetdv wrote on 12/1/2008, 5:52 AM
This will convert the track to a "video track" and then get the first/default keyframe. Naturally you'd need to loop to see all keyframes and you can add and delete keyframes. Once you have the keyframe, you can adjust it as desired.

VideoTrack vidtrack = track as VideoTrack;
TrackMotionKeyframe trackKeyframe = vidtrack.TrackMotion.MotionKeyframes[0];

Also note that Vegas Pro 8.0 is required for this as well. Previous versions did not allow access to Track Motion.
2G wrote on 12/1/2008, 6:04 AM
Thanks. So it is indeed a property of VideoTrack. This property is not listed in the latest API document (I refreshed yesterday from the Sony site just to be sure).

Thanks again.