Command to delete all unused (empty) tracks at once?

cadudesun wrote on 6/19/2020, 3:44 PM

Hi,

Is there a command to delete all unused (empty) tracks at once?

By unused tracks I'm referring to tracks without any event.

I could select the tracks manually, then press delete. However, I'm looking for a smarter command, that would remove every unused track and clean up the time line automatically.

Thank you!

Comments

wwaag wrote on 6/19/2020, 5:49 PM

This can easily be done with a very simple script. I first looked at the 1-click Commands in Vegasaur, but didn't see one. If you're interested I can make one available.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

wwaag wrote on 6/19/2020, 8:39 PM

You can now download the script RemoveEmptyTracks at the HappyOtter Free Tools library at https://tools4vegas.com/library/ Hope you find it useful.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Steve_Rhoden wrote on 6/19/2020, 11:48 PM

A very handy script you created there again wwaag.....👍👍

wwaag wrote on 6/20/2020, 12:16 AM

@Steve_Rhoden

Glad you find it useful. Actually, I can't count the number of times I've done the same thing as the OP--go through and manually delete all of the empty tracks. It only took a few minutes to put together (actually I had already written the method as part of HOS where it is used quite frequently during clean-up.) so it was worth the effort.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Steve_Rhoden wrote on 6/20/2020, 12:33 AM

True indeed wwaag. Over the many years of editing i have been doing this manually, and never crossed my mind for an automated solution lol.

Steve_Rhoden wrote on 6/20/2020, 12:53 AM

Oh, just one minor fix waag..... The png icon dimension you have for this script is currently 20 x 20, so it wont be picked up by Magix Vegas Pro for some users, having it at the script default png size of 16 x 16 fixes that.

Also just wondering if its possible that if a filter alone is on a track at the composite level, can that track be not deleted? (would may be a bit more intuitive to have that)

cadudesun wrote on 6/20/2020, 6:38 AM

You can now download the script RemoveEmptyTracks at the HappyOtter Free Tools library at https://tools4vegas.com/library/ Hope you find it useful.

Many thanks for developing and sharing such a handy script @wwaag!

For easier use, I set a global shortcut [Ctrl+Del] to RemoveEmptyTracks.

wwaag wrote on 6/20/2020, 11:41 AM

@cadudesun

Glad you find it useful. Use of a global shortcut is a good way to go for things that you use a lot.

@Steve_Rhoden

The png was an oversight on my part. I didn't check the pixel dimensions. That's now fixed and the zip file now contains the correct png file for use in Vegas.

I'm not sure exactly what you mean. If an empty track has a filter and is a child to a track with content, then skip deletion? My understanding of compositing is minimal so please splain.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Steve_Rhoden wrote on 6/20/2020, 1:01 PM

Yeah Meaning, If an empty track has a filter on it or it is a child/parent to a track without content, then skip deletion!.....

That sums up what im getting at thanks.

Marco. wrote on 6/20/2020, 2:55 PM

It's the (empty) parent track only which needs to be saved, right? Because an empty parent track often is used as an adjustment layer to all of its child tracks.

wwaag wrote on 6/20/2020, 6:55 PM

@Steve_Rhoden

Try this. https://www.dropbox.com/s/vr9qqsl5suav7na/RemoveEmptyTracks.dll?dl=0

Tracks will be deleted only if no events and no Fx added. There is no check whether it is a Parent or Child. Make sure that you check the file to make sure Windows hasn't blocked it which it often does when downloading from DropBox. If it's not exactly what you want, let me know.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

joelsonforte.br wrote on 6/20/2020, 7:22 PM

Great job Wayne!

I liked both scripts. Both are very useful. To differentiate one from the other just name one of them as "RemoveEmptyTracks" and another as "RemoveEmptyTracks (keep tracks with FX)".

Steve_Rhoden wrote on 6/20/2020, 8:15 PM

Wonderful wwaag Wonderful!..... Exactly what i had in mind, Thanks.

relaxvideo wrote on 6/21/2020, 1:59 AM

Nice. Is it also possible to delete events which will be not visible at all, because of top events cover these 100%?

I don't use any compositing mode, etc, just simple multicam edits with hard cuts, so it would be very nice to delete the bottom events, for way faster rendering!!

many thanks

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

wwaag wrote on 6/21/2020, 9:50 PM

@relaxvideo

I suspect that it could be done, although obviously it would be a lot more complex than removing empty tracks. How about posting a couple of screengrabs of representative projects to give me a better idea of what would be entailed?

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

lan-mLMC wrote on 6/21/2020, 11:40 PM

@wwaag It will delete empty but useful track of which the parent 3D track motion controls many 3d child tracks in 3d camera space.

Is it possible to only delete empty tracks which is not parent tracks and which don't posses any custom parent or child track motion, any custom composite mode, any custom envelop... that is to say don't posses any custom settings ?

wwaag wrote on 6/22/2020, 1:14 AM

@lan-mLMC

I'm pretty sure it's possible so long as the API supports access. The problem is that with each added layer of complexity, one either has a large number of very "specific" scripts or a "general" script that provides the user options to pick and choose. In such cases,it's probably best to have a very simple UI where the user chooses and those choices are saved to the registry so that it can be executed without having to show the UI each time. With something so simple as deleting empty tracks, I'm not sure it's worth the effort.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Marco. wrote on 6/22/2020, 1:22 AM

A simple workaround could be putting an empty event into the parent track.

lan-mLMC wrote on 6/22/2020, 4:29 AM

@lan-mLMC

I'm pretty sure it's possible so long as the API supports access. The problem is that with each added layer of complexity, one either has a large number of very "specific" scripts or a "general" script that provides the user options to pick and choose. In such cases,it's probably best to have a very simple UI where the user chooses and those choices are saved to the registry so that it can be executed without having to show the UI each time. With something so simple as deleting empty tracks, I'm not sure it's worth the effort.

indeed

relaxvideo wrote on 6/22/2020, 3:00 PM

@wwaag:

Here is a quick example 3 cam timeline.
The main camera was the total view and i had 2 additional B camera, which picture is not always fine (zooming, focus adjust, etc), so i only add these events when perfect.
If no fx added at all, timeline playback and rendering is fast, only the topmost events are computed.
But as soon as i add a levels fx to the first B2 for example, that part will be slow rendered and choppy playback on the timeline. What is even more interesting, that even when i disable the fx (unckeck) speed is still slow (main track is computed). It will be fast only, when i completely delete the unchecked (!) levels fx.
This is a seriuous bug, i think.

So with a script is it possible to split events at all cut points and delete bottom events which are not visible at all?

Many thanks!

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

wwaag wrote on 6/22/2020, 4:07 PM

So something like this?

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

relaxvideo wrote on 6/27/2020, 2:58 AM

Eeexactly!

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

wwaag wrote on 6/27/2020, 4:11 PM

@relaxvideo

Done. Here's a demo of what the script Remove Hidden Events does.

It can be downloaded in the HappyOtter Free Tools Library at https://tools4vegas.com/library/ I hope you have no objections to my use of the graphic you uploaded.

Note that you must select the tracks before running the script. As a precaution, I'd also recommend that you do a SaveAs to a new project for any important work before running the script. While you can always Undo the execution of a script, you may find at some later point that you want to "start over". Just a suggestion.

Let me know if there are problems.

Last changed by wwaag on 6/27/2020, 4:14 PM, changed a total of 2 times.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

relaxvideo wrote on 6/28/2020, 1:05 AM

Fantastic, it works on both V11 & V12, many thanks! :)

Of course you can use my (our) graphic for description.

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest