8.1 CompositeNestingLevel Bug

dbritta1 wrote on 1/13/2009, 3:30 PM
The following script worked in Vegas 8.0c and earlier, but fails under Vegas 8.1 running on Quad Core machine running Vista 64bit.

try
{
// create a new project with two mask, video, and audio tracks.
Project project = new Project();

trackMaskLeft = new VideoTrack(0, "L Mask");
project.Tracks.Add(trackMaskLeft);
trackVideoLeft = new VideoTrack(1, "L Video");
project.Tracks.Add(trackVideoLeft);
trackAudioLeft = new AudioTrack(2, "L Audio");
project.Tracks.Add(trackAudioLeft);
trackMaskRight = new VideoTrack(3, "R Mask");
project.Tracks.Add(trackMaskRight);
trackVideoRight = new VideoTrack(4, "R Video");
project.Tracks.Add(trackVideoRight);
trackAudioRight = new AudioTrack(5, "R Audio");
project.Tracks.Add(trackAudioRight);

trackMaskLeft.CompositeMode = CompositeMode.Multiply;
MessageBox.Show("Create_New_Project 3 ");
// DIES HERE !!!
// trackVideoLeft.CompositeNestingLevel = 1;
MessageBox.Show("Create_New_Project 4 ");
// ERROR "TRACK is not compositing parent" if CompositeNestingLevel is commented out
// trackMaskLeft.ParentCompositeMode = CompositeMode.Add;

MessageBox.Show("Create_New_Project 5 ");
trackMaskRight.CompositeMode = CompositeMode.Multiply;
MessageBox.Show("Create_New_Project 6 ");

// DIES HERE !!!
// trackVideoRight.CompositeNestingLevel = 1;
MessageBox.Show("Create_New_Project 7 ");
// ERROR TRACK is not compositing parent
// trackMaskRight.ParentCompositeMode = CompositeMode.Add;
.
.
.

What is going on?

Dennis

Comments

jetdv wrote on 1/13/2009, 4:06 PM
How are the track variables defined?
dbritta1 wrote on 1/13/2009, 4:07 PM
public class CTimeline_Create
{
public int nError = 0;

private CTimeline_Utils cTimeline_Utils;
private TIMELINE_TYPE eLoadType = TIMELINE_TYPE.SideBySideCompressed;
private VideoStream streamMaskCyan;
private VideoStream streamMaskRed;
private VideoStream streamMaskWhite;
private string strInputDirectory;
private AudioTrack trackAudioLeft;
private AudioTrack trackAudioRight;
private VideoTrack trackMaskLeft;
private VideoTrack trackMaskRight;
private VideoTrack trackVideoLeft;
private VideoTrack trackVideoRight;
private Vegas vegas;
.
.
.
dbritta1 wrote on 1/29/2009, 5:56 AM
I have the following script and csproj available in a NestingBug.zip file, how would I attach or upload the zip file?

/////////////////////////////////////////////////////////////////////////////
// NestingBug.cs Dr. Dennis A. Brittain
// This script works with Vegas 8.0
// but HANGS under Vegas 8.1
/////////////////////////////////////////////////////////////////////////////
using System;
using System.Windows.Forms;
using Sony.Vegas;

public partial class EntryPoint
{
private AudioTrack trackAudioLeft;
private AudioTrack trackAudioRight;
private VideoTrack trackMaskLeft;
private VideoTrack trackMaskRight;
private VideoTrack trackVideoLeft;
private VideoTrack trackVideoRight;

public void FromVegas(Vegas vegasParent)
{
try
{
Project project = new Project();
trackMaskLeft = new VideoTrack(0, "L Mask");
project.Tracks.Add(trackMaskLeft);
trackVideoLeft = new VideoTrack(1, "L Video");
project.Tracks.Add(trackVideoLeft);
trackAudioLeft = new AudioTrack(2, "L Audio");
project.Tracks.Add(trackAudioLeft);
trackMaskRight = new VideoTrack(3, "R Mask");
project.Tracks.Add(trackMaskRight);
trackVideoRight = new VideoTrack(4, "R Video");
project.Tracks.Add(trackVideoRight);
trackAudioRight = new AudioTrack(5, "R Audio");
project.Tracks.Add(trackAudioRight);

trackMaskLeft.CompositeMode = CompositeMode.Multiply;

// This is where the script hangs !!!
trackVideoLeft.CompositeNestingLevel = 1;

trackMaskLeft.ParentCompositeMode = CompositeMode.Add;

trackMaskRight.CompositeMode = CompositeMode.Multiply;

// This is where the script hangs !!!
trackVideoRight.CompositeNestingLevel = 1;

trackMaskRight.ParentCompositeMode = CompositeMode.Add;
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
jetdv wrote on 1/29/2009, 7:17 AM
Do you have webspace where you could upload the file and then post a LINK to the file? Then we could download and test it as well.
dbritta1 wrote on 1/29/2009, 11:15 AM
Dear jetdv,

The NestingBug.ziq file contains the source and project files.

http://medtron.org/zTest.aspx

Dennis
jetdv wrote on 1/29/2009, 4:38 PM
As of this point, I can say two things:

1. Your DLL files locks up Vegas Pro 8.1. I have to kill it.

2. If I take your CS file and remove the "Partial" from the class, I can run the CS file directly in Vegas Pro 8.1 and it works.
dbritta1 wrote on 1/30/2009, 6:50 AM
The "partial" keyword was from the original script that has a UI.
I removed the "partial" keyword and recompiled the NestingBug.dll

I tested the revised NestingBug.dll and NestingBug.cs on two machines.
Both the dll and the script file worked properly on the XP machine.
Both the dll and the script file HUNG Vegas on the Vista machine.

Since the NestingBug.cs script failed on the Vista machine,
we can address dll issues later.

Commenting out the following lines allowed the script to run on the Vista machine.
// trackVideoLeft.CompositeNestingLevel = 1;
// trackVideoRight.CompositeNestingLevel = 1;

Since the CompositeNestingLevel was not set there were appropriate warnings
when executing the following lines.
trackMaskLeft.ParentCompositeMode = CompositeMode.Add;
trackMaskRight.ParentCompositeMode = CompositeMode.Add;

Did you run the original NestingBug.dll with Vegas 8.0?
Did you run your revised NestingBug.cs with Vegas 8.1 on a QuadCore machine?

I do not have a Vista (32bit) machine running Vegas 8.0.
Can you test the revised NestingBug.cs on any other machines with Vegas 8.1?

//////////////////////////////
XP TEST MACHINE FOR VEGAS 8.0
Vegas Version: Version 8.0b (Build 217)
ApplicationDataPath: C:\Documents and Settings\dab\Application Data\Sony\Vegas Pro\8.0
InstallationDirectory: C:\Program Files\Sony\Vegas Pro 8.0
OSVersion: Microsoft Windows NT 5.1.2600 Service Pack 3
Version: 2.0.50727.1433
ProcessorCount: 2
MonitorCount: 1
CommandLine: "C:\Program Files\Sony\Vegas Pro 8.0\vegas80.exe"
CurrentDirectory: C:\Documents and Settings\dab\Desktop

//////////////////////////////
VISTA TEST MACHINE FOR VEGAS 8.1
Vegas Version: Version 8.1 (Build 171) 64-bit
ApplicationDataPath: C:\Users\dab\AppData\Roaming\Sony\Vegas Pro\8.1
InstallationDirectory: C:\Program Files\Sony\Vegas Pro 8.1
OSVersion: Microsoft Windows NT 6.0.6001 Service Pack 1
Version: 2.0.50727.1434
ProcessorCount: 4
MonitorCount: 1
CommandLine: "C:\Program Files\Sony\Vegas Pro 8.1\vegas81.exe"
CurrentDirectory: C:\Users\dab\Desktop

dbritta1 wrote on 1/30/2009, 8:16 AM
/////////////////////////////////////////////////////////////////////////////
// NestingBug.cs Dr. Dennis A. Brittain
// This script works with Vegas 8.0 and under Vegas 8.1
// Reordering the function calls fixed the problem!
/////////////////////////////////////////////////////////////////////////////
using System;
using System.Windows.Forms;
using Sony.Vegas;

public class EntryPoint
{
private AudioTrack trackAudioLeft;
private AudioTrack trackAudioRight;
private VideoTrack trackMaskLeft;
private VideoTrack trackMaskRight;
private VideoTrack trackVideoLeft;
private VideoTrack trackVideoRight;

public void FromVegas(Vegas vegasParent)
{
try
{
Project project = new Project();
trackMaskLeft = new VideoTrack(0, "L Mask");
project.Tracks.Add(trackMaskLeft);
trackMaskLeft.CompositeMode = CompositeMode.Multiply;
trackVideoLeft = new VideoTrack(1, "L Video");
project.Tracks.Add(trackVideoLeft);
trackVideoLeft.CompositeNestingLevel = 1;
trackMaskLeft.ParentCompositeMode = CompositeMode.Add;
trackAudioLeft = new AudioTrack(2, "L Audio");
project.Tracks.Add(trackAudioLeft);
trackMaskRight = new VideoTrack(3, "R Mask");
project.Tracks.Add(trackMaskRight);
trackMaskRight.CompositeMode = CompositeMode.Multiply;
trackVideoRight = new VideoTrack(4, "R Video");
project.Tracks.Add(trackVideoRight);
trackVideoRight.CompositeNestingLevel = 1;
trackMaskRight.ParentCompositeMode = CompositeMode.Add;
trackAudioRight = new AudioTrack(5, "R Audio");
project.Tracks.Add(trackAudioRight);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
}
/////////////////////////////////////////////////////////////////////////////
// END NestingBug.cs Dr. Dennis A. Brittain
/////////////////////////////////////////////////////////////////////////////