Change Event Length in a Script can corrupt Storyboard and cause crash

Harold-Linke wrote on 11/5/2018, 11:43 AM

By chance, while working on a VEGASPython Tutorial, I stumbled over following issue:

In a script you have 3 possibilities to change the length of an event:

  1. Event.Length = timecode.FromString("00:00:04:00");
  2. Event.AdjustStartLength(trackEvent.Start, Timecode.FromString("00:00:04:00"),false);
  3. Event.AdjustStartLength(trackEvent.Start, Timecode.FromString("00:00:04:00"),true);

The difference between 2. and 3. is: "whether to adjust the edges of the event's takes" (Definition in the API)

According to the API all 3 versions are valid.

But: If you use version 1 or 2 the storyboard behaves strange and finally crashes.

Only version 3 is ok.

What makes this worse: That this issue is stored in the project and it is possible that you have used a script some years ago that adjusts the event length by using version 1 or 2. Upto now this was no problem. But now the storyboard start crashing.

Here is how to reproduce this issue step-by-step.

  1. restart VEGAS16 and start with a new empty timeline
  2. add an event to the timeline with a length of minimum 10 seconds
  3. open the timeline storyboard. Refresh the storyboard. You should see the event in the storyboard
  4. shorten the event at begin and end by approx 2 seconds. You should see now the in- and out-lines in the storyboard thumbnail (see image below)
  5. Now select the event (Video and Audio) and execute the following C# script:

using ScriptPortal.Vegas;

public class EntryPoint
{
    Vegas myVegas;

    public void FromVegas(Vegas vegas)
    {
       myVegas = vegas;

       foreach (Track track in myVegas.Project.Tracks)
        {
            foreach (TrackEvent trackEvent in track.Events)
            {
                if (trackEvent.Selected)
                {
                    trackEvent.AdjustStartLength(trackEvent.Start, Timecode.FromString("00:00:04:00"),false);
                }
            }
        }
    }
}

6. The script reduces the length of the event to 4 seconds. now refresh the storyboard

You will see that the in- and out-lines did not come closer as expected, but they are now at the edge of the event.

7. Move the left out-line up to the middle of the thumbnail.

Uups. The event on the timline vanishes. (see above)

8. Refresh the storyboard

The out-line is back to the edge.

9. Now try to move the right in-line. And refresh the storyboard.

I receive then an error message: (in German - English translation:" It says that there is abn Error while working with the UNDO-Buffer. It is recommended to save the project and close VEGAS immediatly."

 

I have done some investigation and it looks as if the problem is that in the case of the error the event length and the length of the take are not consistent anymore. Former VEGAS versions seem to have no problem with that. The Storyboard has.

As I wrote above, it is possible that a script you used some time ago is creating this issue. So it is possible when you open an old project that the storyboard behaves strange.

I think I have found a possibility to cure the problem. But I need some more time to verify this. If you have this issue please contact me and I may be able to help you.

Harold

 

Comments

No comments yet - be the first to write a comment...