Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums VEGAS Pro script to move on y axis

  • script to move on y axis

    Posted by Valerie Morrison on June 14, 2009 at 3:49 pm

    Hey everyone,

    I’ve got 6 tracks each with 1 video event. Each of these videos have several keyframes on 3d alpha track motion (hope I’m saying this correctly).

    I want to move every video (at every keyframe) on the y-axis. Basically I need to move the videos (which are like PIPs) so that they are centered vertically on the screen. I was hoping to use a quick script to loop through all of the tracks and just change the positionY = 0 for all keyframes. I’ve found a few things while doing research, but nothing that I find simple enough.

    Can anyone point me to a simple 3d track motion looping script?

    Thanks

    Valerie

    John Rofrano replied 17 years, 1 month ago 3 Members · 5 Replies
  • 5 Replies
  • John Rofrano

    June 14, 2009 at 5:49 pm

    Hi Valerie,

    This script will set all of your track motion keyframes so that the Y value is zero. Just cut and paste into a file named ResetTrackMotionY.cs and place it in your Vegas script menu folder.

    /**
     *       Script: ResetTrackMotionY.cs
     *  Description: This script will reset all of the TrackMotion keyframes Y values to zero
     *       Author: John Rofrano
     * Last Updated: June 14, 2009
     **/

    using System;
    using Sony.Vegas;

    class EntryPoint
    {
       public void FromVegas(Vegas vegas)
       {
          foreach (Track track in vegas.Project.Tracks)
          {
             if (track.IsVideo())
             {
                VideoTrack videoTrack = track as VideoTrack;
                if (videoTrack.TrackMotion.HasMotionData)
                {
                   foreach (TrackMotionKeyframe keyframe in videoTrack.TrackMotion.MotionKeyframes)
                   {
                      keyframe.PositionY = 0.0;
                   }
                }
             }
          }
       }
    }

    This script only works in Vegas Pro 8.0 or 9.0.

    ~jr

    http://www.johnrofrano.com
    http://www.vasst.com

  • Valerie Morrison

    June 14, 2009 at 5:58 pm

    Thanks John, that’s exactly what I was looking for. I can use this for the basis of other changes to rotation and position, rather than having to do things manually.

    Thanks so much.

    Valerie

  • John Rofrano

    June 15, 2009 at 1:15 pm

    > I can use this for the basis of other changes to rotation and position, rather than having to do things manually.

    Yes, the other positional attributes are:

    keyframe.PositionX
    keyframe.PositionY
    keyframe.PositionZ
    keyframe.RotationX
    keyframe.RotationY
    keyframe.RotationZ
    keyframe.OrientationX
    keyframe.OrientationY
    keyframe.OrientationZ
    keyframe.RotationOffsetX
    keyframe.RotationOffsetY
    keyframe.RotationOffsetZ

    Glad I could help.

    ~jr

    http://www.johnrofrano.com
    http://www.vasst.com

  • Rob Strobbe

    June 15, 2009 at 3:55 pm

    I see that John came through with a script, but honestly I don’t think you need one. To make several tracks move in unison, all you need to do is insert a new track above them, make each of those a Child of the new one, and then set keyframes for that first one (called the Parent). The rest will move as a group controlled by this Parent track.

    The button to make one track the child of another is at very right of the track header and looks like a bent arrow.

    Rob

  • John Rofrano

    June 16, 2009 at 11:00 am

    Rob, Good point. I was going to mention that but after re-reading the post I felt that the OP was really trying to adjust things and not move them dynamically. But you are correct… the easiest way to move them in unison with with a parent track.

    ~jr

    http://www.johnrofrano.com
    http://www.vasst.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy