Could a script be made to do this?

epirb wrote on 5/17/2005, 4:16 PM
I have a feeling not, but thought I would ask some of you script Guru's like JR.
I have used Excalibur's script for finding unused media, but it would be nice if you could have a script that will find the unused media then have it placed in a media bin.Even if you had to create the bin B4 running the script.
I though that maybe after running the excal script I could create a bin then drag them there but no such luck.

Or does anybody have a different workflow for this, the extra vidtrack that Excal does is ok, but it would be easier to have them in a bin to look at.
This is what I find hard when doing long still montages with many stills, trying to remember which ones I've used and which ones I havent.

Comments

Spot|DSE wrote on 5/17/2005, 4:23 PM
The Audit tool function sorta does this in Ultimate S. It creates a list of unused media, and allows you to save or load that list. But it doesn't bin the unused media....But it could be scripted, yes.
jetdv wrote on 5/17/2005, 9:15 PM
So you're simply wanting them placed in a separate media bin? It could definitely be done but you would also have to be careful because the function looks through ALL bins in the Media Pool and it would be possible, because of that, for the media to be added multiple times. I can look into adding that functionality, though.
JohnnyRoy wrote on 5/18/2005, 7:08 AM
Eric,

Without a lot of error checking, this is really all you need. It will place all unused media in a new media bin that it creates called “Unused Media”. If you want to run it twice, just delete the media bin called “Unused Media” and run it again. I’ll be sure to add this to the next release of Ultimate S. ;-)
/**
* Program: UnusedToMediaBin.js
* Description: This script will place all unused media into a bin labeled Unused Media.
* To run this twice, first delete the Unused Media bin.
*
* Author: Johnny "Roy" Rofrano
* Revision Date: May 18, 2005
**/
import System.Windows.Forms;
import System.Collections;
import Sony.Vegas;

try
{
var unusedMedia : ArrayList = new ArrayList();
for (var media in Vegas.Project.MediaPool)
{
if (media.UseCount == 0)
{
unusedMedia.Add(media);
}
}
if (unusedMedia.Count > 0)
{
var unusedBin : MediaBin = new MediaBin("Unused Media");
Vegas.Project.MediaPool.RootMediaBin.Add(unusedBin);
for (var media in unusedMedia)
{
unusedBin.Add(media);
}
}

MessageBox.Show("Processed " + unusedMedia.Count + " event(s)",
"UnusedToMediaBin Complete", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "UnusedToMediaBin Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Enjoy,

~jr
epirb wrote on 5/18/2005, 2:50 PM
Friggin incredible!
J.R. you are the KING !
as said in a Monty Python sketch once "a man who's boots I would glady lick clean ! "
Well maybe not clean, but thanks alot!
Its works perfectly for what I want!

Man one of these days I gotta learn this stuff, but "code just aint my load".

Thanks Again to all
Eric
Grazie wrote on 5/19/2005, 12:20 AM

Just used it JR! - It does what you say .. however . .. When I delete the "Unused" bin it then doesn't remove from the media from the project - I need to highlight all the unused media and then Right Click and remove from project or what I want to choose. I guess this IS a good thing. I guess when I read, then delete bin, I was thinking it would ALSO remove from Project. Huh, silly me!

Great Script! It will make the 3 Step Tango a thing of the past:

1/- Make an Unused Bin

2/- Go to All Media Sort Media by "Use Count"

3/- Move ZERO Used Count Media ( many options by me to make a mistake here!)

Now all I need to do is "Run Script" - maybe from a Toolbar icon? - and BOSH! Done!

This AND Excalibur4's "Find Unused Wizard" are great tools for THIS messy, forgetful editor - hah!

Grazie