VEGAS Pro 21 - On Sale Now!
DISCLOSURE: Movie Studio Zen is supported by its audience. When you purchase through links on this site, we may earn an affiliate commission.

Idea Disable Resample and Timeline Task Setup Scripts, and How I Use Them

  • Eagle Six
  • Eagle Six's Avatar Offline Topic Author
  • Zen Master
  • Zen Master
  • Check Your Six!
  • Posts: 802
  • Thank you received: 567
A powerful feature of Vegas Pro is the ability to use Scripts for performing operations and tasks. This isn't new and most Vegas Pro users probably already may have used these scripts, but being new to VP13, I thought I would share how I am using two scripts I have found beneficial.

DS - Disable Resample - ALL
TS - Timeline Task Setup

They look like this.....
[img]http://tactrain.net/Vegas Pro 13/Buttons.png[/img]

By default, recent versions of VP, set Video Event properties to 'Smart resample'. With a few exceptions, I always change this to 'Disable resample', via changing in the Properties, or via Switches. The 'Disable Resample - ALL' script, runs through all the video events on the timeline and switches them from whatever they are currently set, to 'Disable resample', in one click, via the top toolbar option I placed using the 'Customize Toolbar' option. I also created a simple icon with a transparent background with white letters 'DR'.

By default, VP doesn't preload task in the timeline. I usually end up with a lot of tasks, so I used a script to preload the timeline, which I call Timeline Task Setup. For this script I made a simple icon, again with a transparent background and red letters 'TS'. This script preloads, in the order I like, with the names I like to use, 10 tasks which are a mix of video, text, overlay, sound effect, and music tracks.

After copying the javascripts and icons to the proper folder, and restarting Vegas, they showed up in the Tools > Scripting menu......
[img]http://tactrain.net/Vegas Pro 13/Scripts.png[/img]


Then I used the Customize Toolbar feature.....
[img]http://tactrain.net/Vegas Pro 13/Customize Toolbar.png[/img]
.....along with a couple Separator lines to place them on the top toolbar.

I didn't invent any of this and I'm sure other Vegas Pro users are doing similar. However, if any new user would like the files and step-by-step, I would be happy to post it.
Best Regards......George
Last Edit:20 Jan 2016 22:31 by Eagle Six
The following user(s) said Thank You: DoctorZen, Richard Jones, Archlich

Please Log in or Create an account to join the conversation.

That would be great, George!

Scripting's a bit over my head, but I'd love to see what kinds of things can be done with it.

Cheers
:)
Ego svm post mortem.
Ego svm vltra.

Please Log in or Create an account to join the conversation.

  • Eagle Six
  • Eagle Six's Avatar Offline Topic Author
  • Zen Master
  • Zen Master
  • Check Your Six!
  • Posts: 802
  • Thank you received: 567

Replied by Eagle Six on topic Disable Resample and Timeline Task Setup Scripts, and How To

Posted 24 Jan 2016 04:51 #3
Hi Archlich,

This may appear to be long and complex, but as you step through it, I'm sure you are familiar with many of the steps and it's not that bad subsequent times. It is similar to how hundreds of scripts found on the web can de downloaded and implemented in Vegas Pro.

The Disable Resample and Timeline Track Setup scripts are coded in Javascript. Javascript can be authored using any plain text editor such as Windows Notepad. The script files must of course contain the recognized syntax and parameters and the filename extension must be '.js' (java script). For these two examples the files names I have used are:

Disable Resample - ALL.js
TrackSetUp.js

To implement the scripts as I have described in my previous post you will also need these two files (which are the graphic icon files):

Disable Resample - ALL.js.png
TrackSetUp,js,png

In addition to these four files you will need to locate the Vegas 'Script Menu' folder on your PC. In some Vegas installations the 'Script Menu' folder will be in your 'user' area. In others, such as mine, it will be in your 'Programs Files' directory as like:

C:\Programs Files\Sony\Vegas Pro 13\Script Menu (change the '13' to your version of Vegas if required).
[img]http://tactrain.net/Vegas Pro 13/Script Menu.png[/img]


To get started I would recommend making a folder of your choice (name and location) to place all these files prior to putting them in the 'Script Menu' folder. On my data drive I have a folder 'Downloads', in that I have a folder 'Vegas Pro 13', in that I have a folder 'Scripts' (D:\Downloads\Vegas Pro 13\Scripts).

To get the script file 'Disable Resample - ALL.js', go to this link: Disable Resample - ALL

It should look like this in your browser:

[img]http://tactrain.net/Vegas Pro 13/Disable Resample - ALL.png[/img]

'Select All' then, 'Copy', and 'Paste' into Windows Notepad. Save this file to your selected folder as 'Disable Resample - ALL.js'. Notepad defaults to the '.txt' file extension, so you will need change the 'Save as type:' from 'Text Documents (*.txt)' to 'All Files (*.*)'. Also, 'Encoding:' should be 'ANSI'.

To get the icon file go to this link:
Disable Resample - ALL Icon


It should look like this in your browser (very small):

[img]http://tactrain.net/Vegas Pro 13/DR Icon.png[/img]

Right click on the small icon image, then select 'Save image as...' (or it may be 'Save link as' on your system), then save it to your selected folder as 'Disable Resample - ALL.js.png'.

Now you should have the 2 necessary files to implement the Disable Resample - ALL script. If it's not already, shut down Vegas Pro. Copy both these files to the Vegas Pro 13 'Script Menu' folder, you found earlier (if your copy of Vegas Pro is a different version such as version 12, then it would be Vegas Pro 12\Script Menu).

Start Vegas Pro. Go 'Tools', 'Scripting'. The 'Disable Resample - ALL' script should show in the list (if not, select 'Rescan Script Menu Folder'. You can run the script from here by simply clicking on it.

Select 'Options', Customize Toolbar...'. Toolbar options, that are not currently on the toolbar, are displayed in the left window, and those options which are on the toolbar are displayed in the right window (there is one exception and that is the 'Separator' line which will always display in both windows).

Select the 'Separator' in the left window, click on the 'Add ->' button in the middle. Then scroll down the list in the left window until you find 'Disable Resample - ALL' and select it. Again, click on the 'Add ->' button, which will take it from the left window and place it in the right window. Select 'Close'. You should now have the 'Disable Resample - ALL' icon 'DR' on your top Toolbar. Simply left click on the 'DR' icon and the script will run through all the video events in your timeline and disable resampling. It should only take a few seconds or less.

Keep in mind you can also reorder the icon options in your Toolbar by using the Move Up/Move Down buttons. See the 'Help' in Vegas Pro if you are not familiar with how this works.

Repeat all these steps if you want the Timeline Track Setup script, using these links:

Timeline Track Setup Script

Timeline Track Setup Icon

I will follow-up this post with additional information on how to modify the Timeline Track Setup script to fit your own personal preferences.

Credits:
The 'Disable Resample - ALL' script is from John Meyer.
The 'Timeline Track Setup' script is from John Rofrano and modified by me.
Thank You John and John.
Best Regards......George
Last Edit:24 Jan 2016 05:13 by Eagle Six
The following user(s) said Thank You: Archlich

Please Log in or Create an account to join the conversation.

  • Eagle Six
  • Eagle Six's Avatar Offline Topic Author
  • Zen Master
  • Zen Master
  • Check Your Six!
  • Posts: 802
  • Thank you received: 567

Replied by Eagle Six on topic Javascripts and Icons

Posted 24 Jan 2016 06:31 #4
Javascript........

The 'Timeline Track Setup' script (TrackSetUp.js) was published by John Rofrano. I modified the script to add the tracks I like and in the order I like them. Adding, deleting or re-ordering the tracks is simple by using a plain text editor such as Windows 'Notepad'.

In Javascript language blank lines are a null, meaning they are ignored, and can be used to organize the code lines and make it easier to read. Lines starting with

/**, *, and **/ is used for documentation. This provides a method to document the code and make it easier to understand the flow of command syntax and parameters. For example the following would be ignored by the Javascript processor:

/**
* This is a simple script for Vegas Pro
**/

Double hash (or double forward slash) // can also be used for documentation as seen in this example:

{
track = new AudioTrack(index, name); // create audio track
}


track = new AudioTrack(index, name); is a command syntax, however the

// create audio track is a comment documentation which will be ignored.



This is my TracSeUp.js code:

/**
* Program: TrackSetup.js
* Description: This script will create some initial tracks in Vegas for Video,
* Audio, Video Overlay, and Title. This is for people who don't
* like the fact that Vegas starts without labeled tracks.
*
* Author: Johnny (Roy) Rofrano john_rofrano@hotmail.com
* (modified 01-15-2016 George Dean)
* Date: March 29, 2004
**/

import Sony.Vegas;
import System.Windows.Forms;

try
{
// Add three video tracks
AddTrack(1, MediaType.Video, "Text 1");
AddTrack(2, MediaType.Video, "Text 2");
AddTrack(3, MediaType.Video, "Overlay 1");
AddTrack(4, MediaType.Video, "Camera B");
AddTrack(5, MediaType.Audio, "Audio B");
// Add threee Audio tracks
AddTrack(6, MediaType.Video, "Camera A");
AddTrack(7, MediaType.Audio, "Audio A");
AddTrack(8, MediaType.Audio, "Sound Effects")
AddTrack(9, MediaType.Audio, "Music 1");
AddTrack(10, MediaType.Audio, "Music 2");
;
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "TrackSetup Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

/*
* Adds a track to the project with a name and index
*/
function AddTrack(index : int, mediaType : MediaType, name : String)
{
var track;
if (mediaType == MediaType.Audio)
{
track = new AudioTrack(index, name); // create audio track
}
else
{
track = new VideoTrack(index, name); // create video track
}

Vegas.Project.Tracks.Add(track); // add the track
}


This script creates 10 tracks in this order

1. video track for Text/Title named Text 1
2. video track for Text/Title named Text 2
3. video track for Overlay named Overlay 1
4. video track named Camera B
5. audio track named Audio B
6. video track named Camera A
7. audio track named Audio A
8. audio track named Sound Effects
9. audio track named Music 1
10. audio track named Music 2

This is an example how the tracks can be changed from 10 to five (change only the part of the script as shown below in this example)[strike][/strike]:


Step 1: Remove the lines below which have been lined out

{
// Add three video tracks
AddTrack(1, MediaType.Video, "Text 1");
[strike]AddTrack(2, MediaType.Video, "Text 2"); [/strike]
AddTrack(3, MediaType.Video, "Overlay 1");
[strike]AddTrack(4, MediaType.Video, "Camera B");[/strike]
[strike]AddTrack(5, MediaType.Audio, "Audio B");[/strike]
// Add threee Audio tracks
AddTrack(6, MediaType.Video, "Camera A");
AddTrack(7, MediaType.Audio, "Audio A");
[strike]AddTrack(8, MediaType.Audio, "Sound Effects")[/strike]
AddTrack(9, MediaType.Audio, "Music 1");
[strike]AddTrack(10, MediaType.Audio, "Music 2");[/strike]
;
}


Step 2: The code will then look like this

{
// Add three video tracks
AddTrack(1, MediaType.Video, "Text 1");
AddTrack(3, MediaType.Video, "Overlay 1");
// Add threee Audio tracks
AddTrack(6, MediaType.Video, "Camera A");
AddTrack(7, MediaType.Audio, "Audio A");
AddTrack(9, MediaType.Audio, "Music 1");
;
}


Step 3: Change the 'AddTrack' sequence number, from 1, 3, 6, 7, 9 to 1, 2, 3, 4, 5, which should then look like this

{
// Add three video tracks
AddTrack(1, MediaType.Video, "Text 1");
AddTrack(2, MediaType.Video, "Overlay 1");
// Add threee Audio tracks
AddTrack(3, MediaType.Video, "Camera A");
AddTrack(4, MediaType.Audio, "Audio A");
AddTrack(5, MediaType.Audio, "Music 1");
;
}


Step 4: Change the track names to something like this

{
// Add three video tracks
AddTrack(1, MediaType.Video, "Text");
AddTrack(2, MediaType.Video, "Overlay");
// Add threee Audio tracks
AddTrack(3, MediaType.Video, "Video");
AddTrack(4, MediaType.Audio, "Audio");
AddTrack(5, MediaType.Audio, "Music");
;
}


Step 5: Clean up the documentation comments so it looks like this

{
// Add four video tracks
AddTrack(1, MediaType.Video, "Text");
AddTrack(2, MediaType.Video, "Overlay");
AddTrack(3, MediaType.Video, "Video");
// Add two audio tracks
AddTrack(4, MediaType.Audio, "Audio");
AddTrack(5, MediaType.Audio, "Music");
;
}


Step 6: Save the file to the original 'TrackSetUp.js', or any other name you prefer


Script Icon......

The script icon can be created using any of the Icon Creator programs, or something like Photoshop. I use PaintshopPro X8.

Create a 16x16 raster with transparent background. Then put whatever you like, art or, as I did simply text. You can be as creative as the file pixel size permits. Save it as a transparent PNG file with the same name as your Javascript file including the .js extension, such as 'TracSetUp.js.png'. Or, simply use mine provided above.
Best Regards......George
The following user(s) said Thank You: Archlich

Please Log in or Create an account to join the conversation.

Replied by Archlich on topic Javascripts and Icons

Posted 24 Jan 2016 11:51 #5
Thank you very much, sir!
Ego svm post mortem.
Ego svm vltra.

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: DoctorZen
Time to create page: 0.846 seconds