Interesting no-one else has noticed it. I can reproduce the bug easily:
For example:
1) Create a bin
2) Dump some media into the bin
3) delete media
Seems like whenever someone deletes media that was placed into a mediabin, the bin ends up in a corrupted state ? Its happened using “Remove from Current Bin”, “Remove from Project”, and “Remove All Unused Media From Project”. Any script that then tries to access the bin will throw an exception.
4) run script Bin-Corruption-0002
Note that the script thinks there is still something inside the bin (Count = 1 ?), but accessing it will cause the exception.
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Sony.Vegas;
namespace Bin_Corruption_0002
{
public class EntryPoint
{
static internal Sony.Vegas.Vegas thisVegas = null;
public void FromVegas(Vegas vegas)
{
using (UndoBlock undo = new UndoBlock(“Bin Corruption Test”))
{
thisVegas = vegas;
MessageBox.Show(thisVegas.Project.MediaPool.RootMediaBin.Count.ToString(), “thisVegas.Project.MediaPool.RootMediaBin.Count”);
// top level should all be bins…
foreach (Sony.Vegas.MediaBin bin in thisVegas.Project.MediaPool.RootMediaBin)
{
MessageBox.Show(bin.Name, “bin.Name”);
MessageBox.Show(bin.Count.ToString(), “bin.Count”);
foreach (Sony.Vegas.IMediaBinNode loopBin in bin)
{
if (loopBin.NodeType == MediaBinNodeType.Bin)
{
MessageBox.Show(((Sony.Vegas.MediaBin)loopBin).Name, “loopBin.Name”);
}
else if (loopBin.NodeType == MediaBinNodeType.MediaRef)
{
MessageBox.Show(((Sony.Vegas.Media)loopBin).FilePath, “loopBin.FilePath”);
}
else
{
MessageBox.Show(“Unknown Media Type ?”, “ERROR”);
}
}
}
}
}
}
}
is there something I’m doing wrong, or has no-one really noticed this before ?
TIA,
krash
Blur Studio