⚠️ (BUG?) New track with CTRL + SHIFT + Q

m3lquixd wrote on 3/3/2023, 8:55 AM

When we selected a track, we clicked with the right mouse button and inserted a new track. The new track is created directly on top of the previously selected track. However, if we select a track and insert a new track using the shortcut CTRL + SHIFT + Q. The new track is created on top of all tracks.

Last changed by m3lquixd

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

Comments

m3lquixd wrote on 3/3/2023, 8:57 AM

@jetdv I think you can create a script with the command to insert a new track on top of the selected track, then just remove the default shortcut and define it for the script.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 3/3/2023, 3:16 PM

Yes, a script can add a track anywhere.

Here's basically what you'd need to do:

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.Selected)
                {
                    VideoTrack newTrack = new VideoTrack(myTrack.Index, "Optional Name");
                    myVegas.Project.Tracks.Add(newTrack);
                    break;
                }
            }

 

m3lquixd wrote on 3/3/2023, 3:58 PM

@jetdv and audio track? please

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 3/3/2023, 4:02 PM

So you want video + audio above the current selected track?

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.Selected)
                {
                    int thisIndex = myTrack.Index;
                    VideoTrack newTrack = new VideoTrack(thisIndex, "Optional Video Track Name");
                    myVegas.Project.Tracks.Add(newTrack);
                    AudioTrack newATrack = new AudioTrack(thisIndex + 1, "Optional Audio Track Name");
                    myVegas.Project.Tracks.Add(newATrack);
                    break;
                }
            }

 

m3lquixd wrote on 3/3/2023, 4:10 PM

Yes, a script can add a track anywhere.

Here's basically what you'd need to do:

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.Selected)
                {
                    VideoTrack newTrack = new VideoTrack(myTrack.Index, "Optional Name");
                    myVegas.Project.Tracks.Add(newTrack);
                    break;
                }
            }

 


@jetdv It doesn't work.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 3/3/2023, 4:11 PM

So you want video + audio above the current selected track?

@jetdv
I want one for the video track and one for the audio track, to replace the native Vegas commands.The video always creating above the selected track and the audio creating below the selected track.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 3/3/2023, 4:33 PM

That's just the "guts" of the script, not the entire script. To scale it down and make it "runable":

Video Track above first selected track:

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Vegas myVegas = vegas;

        foreach (Track myTrack in myVegas.Project.Tracks)
        {
            if (myTrack.Selected)
            {
                VideoTrack newTrack = new VideoTrack(myTrack.Index);
                myVegas.Project.Tracks.Add(newTrack);
                break;
            }
        }
    }
}


 

Audio Track after first selected track:

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Vegas myVegas = vegas;

        foreach (Track myTrack in myVegas.Project.Tracks)
        {
            if (myTrack.Selected)
            {
                AudioTrack newTrack = new AudioTrack(myTrack.Index + 1);
                myVegas.Project.Tracks.Add(newTrack);
                break;
            }
        }
    }
}

 

m3lquixd wrote on 3/3/2023, 4:47 PM

@jetdv 
Worked perfectly. But when I defined a shortcut for the script, I noticed that the execution time is unfortunately slower than Vegas' native create new track function.
Can you do one more thing? I realized that when there is no trail it is not possible to create a new trail. Is there a way to make it also create a track even without selecting any tracks? (I understand that with more lines of code the script will take even longer to run.)

Last changed by m3lquixd on 3/3/2023, 4:50 PM, changed a total of 1 times.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 3/3/2023, 4:55 PM

If no selected track, will add a video track at the top or an audio track at the bottom.

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Vegas myVegas = vegas;
        bool added = false;

        foreach (Track myTrack in myVegas.Project.Tracks)
        {
            if (myTrack.Selected)
            {
                VideoTrack newTrack = new VideoTrack(myTrack.Index);
                myVegas.Project.Tracks.Add(newTrack);
                added = true;
                break;
            }
        }
        if (!added)
        {
            VideoTrack newTrack = new VideoTrack(0);
            myVegas.Project.Tracks.Add(newTrack);
        }
    }
}


 

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Vegas myVegas = vegas;
        bool added = false;

        foreach (Track myTrack in myVegas.Project.Tracks)
        {
            if (myTrack.Selected)
            {
                AudioTrack newTrack = new AudioTrack(myTrack.Index + 1);
                myVegas.Project.Tracks.Add(newTrack);
                added = true;
                break;
            }
        }
        if (!added)
        {
            AudioTrack newTrack = new AudioTrack(myVegas.Project.Tracks.Count);
            myVegas.Project.Tracks.Add(newTrack);
        }
    }
}

 

m3lquixd wrote on 3/3/2023, 5:18 PM

@jetdv Thank you very much! Worked perfectly.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 3/10/2023, 7:20 AM

@VEGASDerek Although our friend jetdv managed to create something that solves the problem, this remains an issue that should be resolved in official updates.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

VEGASDerek wrote on 3/10/2023, 7:47 AM

This is how VEGAS has worked since the beginning of time. It is unlikely we will change this default behavior. However, we could consider some alternate new track options.

m3lquixd wrote on 3/10/2023, 8:01 AM

@VEGASDerek But shouldn't the shortcut's behavior be the same as right-clicking and selecting the option? Since the shortcut is a quick way to do the same function?​​​​​​​

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

VEGASDerek wrote on 3/10/2023, 8:50 AM

It is quite simple the reason behind it...the right click option places the new track at the point where the right click occurred in the timeline. The keyboard shortcut will place a video track at the top of the timeline or and audio track at the bottom since it has not relevance to the mouse cursor. You're assumption that this is based on a selected track is incorrect...it is based on the location of the mouse click.

lan-mLMC wrote on 3/11/2023, 11:20 PM

@VEGASDerek

The current audio track's right-click menu lacks "Create New Video Track",

video track's right-click menu lacks "Create New Audio Track".

Many users would like this to be improved to bring greater flexibility and freedom for Vegas.

m3lquixd wrote on 3/12/2023, 11:49 AM

@lan-mLMC I agree.​​​​​​​
Ps. With this script above you can do that.​​​​​​​

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 12/1/2023, 3:13 PM

@jetdv Good evening, Edward! I would like to update these scripts, in fact it would be like a new version, this current version still makes sense, but this new version I thought would be very useful for my workflow.

The idea is as follows: When a video track is selected, when executing the script, it will create a new video track above the selected video track, however, if an audio track is selected, it will create a new track of audio below it. If an audio and video track were selected at the same time, it would create a new video track above the selected one and a new audio track below the selected one. If no track was selected, as in a new empty Vegas project, when running the script it would create two tracks, a video track on top and an audio track below it. Always in this pattern.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 12/1/2023, 3:18 PM

Here's what I did:

If a video track is selected, a new video track is added above the first selected video track.

if an audio track is selected, a new audio track is added below the first selected video track.

If nothing is selected, a new video track is added at the top and a new audio track is added at the bottom.

So... the four cases are:

  1. Only Video Track selected - add a new video track above that first selected video track
  2. Only Audio Track selected - add a new audio track below that first selected audio track
  3. Both video and audio track selected - add a new video track above that first selected video track and add a new audio track below that first selected audio track
  4. Neither video or audio track selected - add a new video track at the top of the project and add a new audio track at the bottom of the project.
using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            bool FoundVideo = false;
            bool FoundAudio = false;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.Selected && myTrack.IsVideo() && !FoundVideo)
                {
                    FoundVideo = true;
                    VideoTrack newVTrack = new VideoTrack(myTrack.Index);
                    myVegas.Project.Tracks.Add(newVTrack);
                }
                if (myTrack.Selected && myTrack.IsAudio() && !FoundAudio)
                {
                    FoundAudio = true;
                    AudioTrack newATrack = new AudioTrack(myTrack.Index + 1);
                    myVegas.Project.Tracks.Add(newATrack);
                }
                if (FoundAudio && FoundVideo)
                {
                    break;
                }
            }

            if (!FoundAudio && !FoundVideo)
            {
                VideoTrack newVTrack = new VideoTrack(0);
                myVegas.Project.Tracks.Add(newVTrack);

                AudioTrack newATrack = new AudioTrack(myVegas.Project.Tracks.Count);
                myVegas.Project.Tracks.Add(newATrack);
            }

        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

m3lquixd wrote on 12/1/2023, 3:33 PM

Perfect as always. Thank you very much!

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

RedRob-CandlelightProdctns wrote on 12/3/2023, 1:36 AM

@jetdv curious -- in that last code snippet, why'd you include so many dependencies (using...) at the top? Forms... IO... drawing?

Vegas 21.300

My PC (for finishing):

Cyperpower PC Intel Core i7-7700K CPU @ 4.2GHz, 64GB mem @ 2133MHz RAM, AMD Radeon RX470 (4GB dedicated) with driver recommended by Vegas Updater (reports as 30.0.15021.11005 dated 4/28/22), and Intel HD Graphics 630 driver version 31.0.101.2112 dated 7/21/22 w/16GB shared memory. Windows 10 Pro 64bit version 10.0.19045 Build 19045.

My main editing laptop:

Dell G15 Special Edition 5521, Bios 1.12 9/13/22, Windows 11 22H2 (10.0.22621)

12th Gen Intel Core i7-12700H (14 cores, 20 logical processors), 32 GB DDR5 4800MHz RAM, Intel Iris Xe Graphics, NVIDIA GeForce RTX 3070 Ti Laptop GPU w/8GB GDDR6 RAM, Realtek Audio

 

 

jetdv wrote on 12/3/2023, 7:24 AM

@RedRob-CandlelightProdctns, those are all just part of the template I start with. Do I need them all? Typically no, but they're nice to have there if I do need them and I don't have to worry about adding them. Do I need any of them in this case? No.

Robert Johnston wrote on 12/3/2023, 2:09 PM

Deleted my comment. It was in error.

Intel Core i7 10700K CPU @ 3.80GHz (to 4.65GHz), NVIDIA GeForce RTX 2060 SUPER 8GBytes. Memory 32 GBytes DDR4. Also Intel UHD Graphics 630. Mainboard: Dell Inc. PCI-Express 3.0 (8.0 GT/s) Comet Lake. Bench CPU Multi Thread: 5500.5 per CPU-Z.

Vegas Pro 21.0 (Build 108) with Mocha Vegas

Windows 11 not pro

Former user wrote on 12/3/2023, 2:48 PM

@jetdv Hi, I'm very very new to scripts.. so stupid question.. Do you have tutorial that shows how to rename an existing script.. or is this an easy to answer question?

I the script above I saved it as 'Track myTrack in myVegas.Project.Tracks', it works perfectly but if I change that & the cs file name it doesn't work?

Thanks.

jetdv wrote on 12/3/2023, 3:31 PM

To change the name of the script, just change the file name on the hard drive.

1. It must still end with .cs

2. If VEGAS is open, you need to either exit and restart or do a Tools - Scripting - Rescan Script Menu