Remove Unused Media & Save

NickHope wrote on 7/28/2016, 2:16 AM

I made a little script that removes all unused media from a project and then saves it. Not rocket science but I was in the habit of often switching to the Project Media tab and clicking the lightning bolt before saving, so this combines the 2 operations. It's especially useful if, like me, you tend to edit by process of elimination and don't generally have the Project Media window showing.

import System;
import System.Windows.Forms;
import ScriptPortal.Vegas;

try
{
	Vegas.ResumePlaybackOnScriptExit = true;
	Vegas.Project.MediaPool.RemoveUnusedMedia();
	Vegas.SaveProject();
} catch (e)
{
MessageBox.Show(e);
}

Script: https://drive.google.com/file/d/0B8ftVT5A1FqQcHJTazdfUTZBVlk/view?usp=sharing

Icon:

Put the script and icon in your "C:\Program Files\VEGAS\VEGAS Pro 14.0\Script Menu\" folder.

For Vegas Pro 13, change the line ScriptPortal.Vegas to Sony.Vegas and put the script in C:\Program Files\Sony\Vegas Pro 13.0\Script Menu\.

I have customised my toolbar so it sits next to my regular save icon:

Comments

Byron K wrote on 7/28/2016, 2:41 AM
Thanks for sharing Nick. I can see using this. I've been a media pack-rat and just move the whole project to my archive drive and leave it as is. This should save a lot of space and time at the end of a project.
NickHope wrote on 7/28/2016, 3:05 AM
Just to be clear, it only removes the references to the media from the project, as does the lightning bolt at the top of the Project Media window. It doesn't trim or remove any actual media files.
NickHope wrote on 3/7/2017, 12:55 AM

Updated the OP with a line to resume playback after the save (thanks to richardbushell), VP14 compatibility, and revised download link.

OldSmoke wrote on 3/7/2017, 5:48 AM

Vegasaur does that for me.

Proud owner of Sony Vegas Pro 7, 8, 9, 10, 11, 12 & 13 and now Magix VP15&16.

System Spec.:
Motherboard: ASUS X299 Prime-A

Ram: G.Skill 4x8GB DDR4 2666 XMP

CPU: i7-9800x @ 4.6GHz (custom water cooling system)
GPU: 1x AMD Vega Pro Frontier Edition (water cooled)
Hard drives: System Samsung 970Pro NVME, AV-Projects 1TB (4x Intel P7600 512GB VROC), 4x 2.5" Hotswap bays, 1x 3.5" Hotswap Bay, 1x LG BluRay Burner

PSU: Corsair 1200W
Monitor: 2x Dell Ultrasharp U2713HM (2560x1440)

NickHope wrote on 3/7/2017, 7:05 AM

Vegasaur does that for me.

In one click?

OldSmoke wrote on 3/7/2017, 7:18 AM

Vegasaur does that for me.

In one click?


No it's not a one click kind of thing. The 1-Click "Unused Media" button doesn't delete the media but moves it to a media bin called Unused in case you want to use it again. The Project Auditor will find unused media too and that is the function I use at the end of every project because it does a lot more then just looking for unused media.

Proud owner of Sony Vegas Pro 7, 8, 9, 10, 11, 12 & 13 and now Magix VP15&16.

System Spec.:
Motherboard: ASUS X299 Prime-A

Ram: G.Skill 4x8GB DDR4 2666 XMP

CPU: i7-9800x @ 4.6GHz (custom water cooling system)
GPU: 1x AMD Vega Pro Frontier Edition (water cooled)
Hard drives: System Samsung 970Pro NVME, AV-Projects 1TB (4x Intel P7600 512GB VROC), 4x 2.5" Hotswap bays, 1x 3.5" Hotswap Bay, 1x LG BluRay Burner

PSU: Corsair 1200W
Monitor: 2x Dell Ultrasharp U2713HM (2560x1440)

NickHope wrote on 3/7/2017, 7:41 AM

OK, so it's a different thing really. This is just a quick "purge"+save to keep your project lean if that's what you want. Like I say, it's not rocket science but useful in a long cutting session with loads of media.