VP16 Script Bug and suggestion

altarvic wrote on 9/7/2018, 11:45 AM

This example script is for VEGAS Pro 16 and it should work, but it raises an exception:

using ScriptPortal.Vegas;

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        vegas.Project.Video.PixelFormat = PixelFormat.Float32BitFullRange; // Catastrophic failure error
    }
}

This line works, but it changes Pixel format to 32-bit full range instead of 32-bit video levels (this is how it works in all previous Vegas versions)

vegas.Project.Video.PixelFormat = PixelFormat.Float32Bit;

 

My suggestion for Vegas developers - change PixelFormat enum to this:

public enum PixelFormat
{
      Int8Bit,
      Float32Bit,             // full range (how it works now in all Vegas versions)
      Float32BitVideo     // video levels (new option instead of broken Float32BitFullRange)
}

Thus, you will keep compatibility with previous versions.
Thanks.

Comments

NickHope wrote on 10/27/2018, 5:15 AM

With your first script I get the same exception in VP14, 15 & 16:

C:\Program Files\VEGAS\VEGAS Pro 14.0\Script Menu\32-bit-bug-test.cs(7) : 'ScriptPortal.Vegas.PixelFormat' does not contain a definition for 'Float32BitFullRange'

Are you saying that should work based on the scripting API documentation?

With the line in your 2nd code block, I get the same behaviour in VP14, 15 & 16. It changes the pixel format to 32-bit floating point (full range) in all of them.

Are you seeing different behaviour between versions?

altarvic wrote on 10/27/2018, 9:23 AM

In 14 & 15 this test script doesn't work (since the option Float32BitFullRange was added in 16 version).

In 16 I get this error:

 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Catastrophic failure  (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
   at ScriptPortal.Vegas.IProjectCOM.set_ProjectVideoPixelFormat(PixelFormat value)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at ScriptPortal.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
   at ScriptPortal.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)

 

NickHope wrote on 10/28/2018, 12:50 AM

Thanks. I added this to the "Known issues" post. Could you please report it to Support if not already?