Hello everyone !
After my previous successful attempt to create a script that shake a picture in sync with the audio thanks to the tips of the community, i would need again some help with a "easy zoom script" to be used as shortcut on my Streamdeck.
The streamdeck is a little keyboard equipped with customizable keys. In this case, they are used to run Vegas Scripts.
- I intend to use a 3x5 area that will add a zoom on the corresponding position on Vegas at cursor position.
- With 5 different zoom values (1 =0% 2=12% 3=24% 4=36% etc...)
- When the key is pressed the zoom is applied to the selected track by adding 2 keys on cursor positions : The 1st key needs to have the same value of the previous one, and the second one is the new wanted zoom value.
But i can figure out how to select the previous keyframe (before the cursor timecode position) in order to read it's values and apply them to the first new keyframe added by the script.
Anyone knows how to do that ?
Thanks in advance for your time 👍
namespace Test_Script { public class Class1 { public Vegas myVegas; public void Main(Vegas vegas) { myVegas = vegas; foreach (Track myTrack in myVegas.Project.Tracks) { if (myTrack.IsVideo() && myTrack.Selected) { VideoTrack vTrack = (VideoTrack)myTrack; Timecode cursor = vegas.Transport.CursorPosition; TrackMotionKeyframe KF1 = vTrack.TrackMotion.InsertMotionKeyframe(cursor); KF1.Width = PREVIOUS KEY VALUE; KF1.Height = PREVIOUS KEY VALUE; KF1.Type = VideoKeyframeType.Fast; Timecode after = Timecode.FromSeconds(0.25); Timecode aftercursor = cursor + after; TrackMotionKeyframe KF2 = vTrack.TrackMotion.InsertMotionKeyframe(aftercursor); KF2.Width = 2240; //NEW ZOOM VALUE KF2.Height = 1260; //NEW ZOOM VALUE KF2.Type = VideoKeyframeType.Linear; } } } } public class EntryPoint { public Vegas myVegas; public void FromVegas(Vegas vegas) { Test_Script.Class1 test = new Test_Script.Class1(); myVegas = vegas; test.Main(vegas); } } }