Script to ZOOM easily (for software tutorials production)

cadudesun wrote on 7/3/2020, 6:49 PM

Hi,

 

I'm used to Camtasia very practical zoom functionality, and was trying to find out in Vegas the easier method to zoom into areas of the screen, then zoom out from the Event Pan/Crop interface.

This is aimed at software tutorials production.

I record my screen illustrating the steps below, that were the easiest way to perform the task that I found out.

I used a script structure to detail the steps, just as a reference.

The syntax doesn't exist, and here is my question:

=> Is this script possible to be implemented?

class EntryPoint

{

    public void FromVegas(Vegas vegas)

    {

    Step 1 (Restore output - Event Pan/Crop)

    Step 2 (Move cursor right by 0.5sec): vegas.Transport.CursorPosition = vegas.Transport.CursorPosition + Timecode.FromSeconds(0.5);

    Step 3 (Create keyframe)

    Step 4 (Go to Last keyframe)

    Step 5 (Create keyframe)

    Step 6 (Move cursor left by 0.5sec): vegas.Transport.CursorPosition = vegas.Transport.CursorPosition - Timecode.FromSeconds(0.5);

    Step 7 (Create keyframe)

    }

}

 

Thank you!

Carlos

 

Comments

jetdv wrote on 7/4/2020, 10:01 AM

Here's a routine to reset the Pan/Crop. It also removes all keyframes which may give you a clue as to how to properly add the keyframes.

    public void RPC()
    {
      foreach (Track track in Vegas.Project.Tracks)
      {
    
        //Find the first selected event on this track
        foreach (TrackEvent evnt in track.Events)
        {
    
          if (evnt.Selected && evnt.IsVideo()) {
            VideoEvent videoEvent = evnt as VideoEvent;
            VideoMotionKeyframes keyframes = videoEvent.VideoMotion.Keyframes;
            int cKeyframes = keyframes.Count;
    
            for (int jj = cKeyframes - 1; jj >= 0 ; jj--) {
              VideoMotionKeyframe thisKeyframe = keyframes[jj] as VideoMotionKeyframe;
              keyframes.Remove(thisKeyframe);
            }
    
            VideoMotionKeyframe AddKey = new VideoMotionKeyframe(new Timecode(0));
            keyframes.Add(AddKey);
          }
        }
      }
      Vegas.UpdateUI();
    }

 

cadudesun wrote on 7/6/2020, 10:10 AM

@jetdv

Thanks for the directions to start developing the VEGAS script to perform the Camtasia-like Zoom.

While I’m still learning how to develop a VEGAS script, I drafted an AutoHotkey (AHK) script to do the job for now.

 

For anyone interested in the AHK script, the file “AHK_Camtasia-like Keyframes.zip” is available for download here: https://bit.ly/2DfIG7y

 

This screencast details how to use it:

 

Briefly, the instructions are:

 

1- Unzip the file “AHK_Camtasia-like Keyframes.zip”, which has the content:

[Camtasia-like Keyframes].ahk

[Camtasia-like Keyframes].exe

[Cursor-MoveLeft Second 01].cs

[Cursor-MoveRight Second 01].cs

 

2- To run this AHK script properly you need to set up in advance shortcuts to the following Vegas native scripts:

[Cursor-MoveLeft Second 01].cs => Set as "GLOBAL" shortcut Ctrl+Alt+, (Option > Customize Keyboard)

[Cursor-MoveRight Second 01].cs => Set as "GLOBAL" shortcut Ctrl+Alt+. (Option > Customize Keyboard)

The default path to save the VEGAS scripts are:

C:\Program Files\VEGAS\VEGAS Pro 17.0\Script Menu 

 

3- Then just run the file “[Camtasia-like Keyframes].exe” before using VEGAS, or store it in one of the Windows startup folders to start the file automatically:

Current user: C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

All users: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

 

4- In VEGAS, click on the “Event Pan/Crop”.

 

5- Press the shortcut “Ctrl+Insert” to insert Camtasia-like keyframes automatically and set the Zoom itself manually.

 

Heads-up:

- Be sure to use the script when the “Event Pan/Crop” interface is opened. VEGAS use the same “control class” name to identify the “Event Pan/Crop” timeline, as well as the “Track Motion” and the “Trimmer” ones. If the script is triggered while those other interfaces are open, it will perform a set of commands anyway, leading to undesirable results.

- The script works just when the VEGAS window is active, and should not cause any trouble if triggered ONLY when the “Event Pan/Crop” interface is open.

- To create the Camtasia-like keyframes, the script performs:

* Step 1: Focus on the Event Pan/Crop Timeline

* Step 2: Move the cursor to the first keyframe

* Step 3: Copy the first keyframe

* Step 4: Move the cursor to the right by 1 second

* Step 5: Paste the copied keyframe

* Step 6: Move the cursor to the last keyframe

* Step 7: Paste the copied keyframe

* Step 8: Move the cursor to the left by 1 second

* Step 9: Paste the copied keyframe

- If you use the script and notice something is not working as expected or can be improved, please let me know.

 

The script is just a workaround to automate 9 manual steps, and it would be great if VEGAS and/or third-party developers could implement a more elegant and effective solution. VEGAS 17 introduced a screen capture tool, and having in mind its users want to edit screencasts, a Camtasia-like Zoom is a must-have!

 

Regards,

Carlos