Hello All,
Busy evaluating Vegas for use here at Blur (evaluating the scripting side of things), and ran into a strange problem.
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.
For example:
1) Create a bin
2) Dump some media into the bin
(or run script Bin-Corruption-0001 [fix script to point to a valid media file])
3) delete media
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.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at Sony.Vegas.IMediaCOM.GetMetaPathType(UInt32 mediaID, MetaPathType& metaType)
at Sony.Vegas.Media.CreateInstance(UInt32 mediaID)
at Sony.Vegas.MediaBin.GetItem(Int32 index)
at Sony.Vegas.BaseList`1.<GetEnumerator>d__0.MoveNext()
at Bin_Corruption_0002.EntryPoint.FromVegas(Vegas vegas)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sony.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
at Sony.Vegas.ScriptHost.CodeDomScriptManager.Run()
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)
is there something I'm doing wrong, or has no-one noticed this before ?
TIA,
krash
Blur Studio
P.S. Two things that have confused the artist evaluating Vegas (from the art side)
1) The keybinding for the Delete Key is different depending on whether one selects the media in the bin, or in the All Media bin ? It confused him. I recommended to him for now to always use the right-click menu, but is there anyway to override this (tried quicky, but really have not put much time into overriding the keybinding...)
2) The All Media bin itself confused him, in the fact that he did not like a media showing up in two places. We would like to try and force people here to organize stuff into bins (assuming I can get around the corruption problem). is there anyway to remove (or hide ?) the All Media bin ?
Busy evaluating Vegas for use here at Blur (evaluating the scripting side of things), and ran into a strange problem.
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.
For example:
1) Create a bin
2) Dump some media into the bin
(or run script Bin-Corruption-0001 [fix script to point to a valid media file])
3) delete media
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.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at Sony.Vegas.IMediaCOM.GetMetaPathType(UInt32 mediaID, MetaPathType& metaType)
at Sony.Vegas.Media.CreateInstance(UInt32 mediaID)
at Sony.Vegas.MediaBin.GetItem(Int32 index)
at Sony.Vegas.BaseList`1.<GetEnumerator>d__0.MoveNext()
at Bin_Corruption_0002.EntryPoint.FromVegas(Vegas vegas)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sony.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
at Sony.Vegas.ScriptHost.CodeDomScriptManager.Run()
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Sony.Vegas;
namespace Bin_Corruption_0001
{
public class EntryPoint
{
static internal Sony.Vegas.Vegas thisVegas = null;
String testMediaFile = @"Q:\project_TEST\Avis\HiRes\Layout\Ly001\Ly001_S0011.00_.mov";
public void FromVegas(Vegas vegas)
{
using (UndoBlock undo = new UndoBlock("Bin Corruption Test"))
{
thisVegas = vegas;
using (UndoBlock undo2 = new UndoBlock("Create Bin"))
{
Sony.Vegas.MediaBin mBin = new MediaBin("Test Bin 0001");
thisVegas.Project.MediaPool.RootMediaBin.Add(mBin);
using (UndoBlock undo3 = new UndoBlock("Add Media"))
{
Sony.Vegas.Media newMedia = new Media(testMediaFile);
mBin.Add(newMedia);
}
}
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");
}
}
}
}
}
}
}
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 noticed this before ?
TIA,
krash
Blur Studio
P.S. Two things that have confused the artist evaluating Vegas (from the art side)
1) The keybinding for the Delete Key is different depending on whether one selects the media in the bin, or in the All Media bin ? It confused him. I recommended to him for now to always use the right-click menu, but is there anyway to override this (tried quicky, but really have not put much time into overriding the keybinding...)
2) The All Media bin itself confused him, in the fact that he did not like a media showing up in two places. We would like to try and force people here to organize stuff into bins (assuming I can get around the corruption problem). is there anyway to remove (or hide ?) the All Media bin ?