Turn off Loop region?

Grazie wrote on 5/19/2008, 1:51 AM
http://www.sonycreativesoftware.com/forums/ShowMessage.asp?MessageID=594750&Replies=26Carried over from THIS in Vegas Forum . . [/link]

I can't make JM's script function. I Copied and pasted into Notepad and saved as KillRegion.js - yes? Is that correct?

Grazie

Comments

JohnnyRoy wrote on 5/19/2008, 5:48 AM
I'm not sure what John's script is trying to do but this will collapse the loop region thus turning it off in Vegas Pro 8.0 (which I know you are using). This will not work in Vegas 7 and below because it uses the new Vegas Pro 8.0 Transport class.

Here is the code:


/**
* Program: ZeroLoopRegion.cs
* Description: This script will remove the loop region and selection in Vegas Pro 8.0
* Author: John Rofrano
*
* Revision Date: May. 19, 2008
**/

using System;
using Sony.Vegas;

class EntryPoint
{
public void FromVegas(Vegas vegas)
{
vegas.Transport.LoopRegionLength = Timecode.FromNanos(0);
vegas.Transport.SelectionLength = Timecode.FromNanos(0);
}
}

Just cut and paste it into ZeroLoopRegion.cs (not .js !) This would be great to place as an icon on the toolbar. I know I would use it a lot and I'm not sure why I didn't think of it a lot sooner. The loop region drives me nuts too when I don't need it.

~jr
MarkWWW wrote on 5/19/2008, 11:25 AM
Nifty.
willlisub wrote on 6/5/2008, 2:36 AM
I tried the code block in v8, did't work.

I get error occurred during execution of the script ...... zeroloopregion.cs
error 0x8000020(message missing)

I copy the code into a file and saved it has a text file ZeroLoopRegion.cs

It shows up as a cs file type in my script folder under v8.

Did I do this wrong or am I missing something in regards to adding this to some other file.

Also, is there a way to make a keyboard short cut to run either the script menu or a specific script?

Thanks in advance.....
willlisub wrote on 6/5/2008, 2:46 AM
Just went and read the link listed in first post.

I found what I needed in turning off the loop for playing by toggling it on and off using the Q key.

That works for what I want as many times I create a loop region inadvertently. I don't care if it's there, I just want to be able to play through it many time.

What is the intent of the zeroloopregion.cs.?

Disable loop region or erase current loop region?

jetdv wrote on 6/5/2008, 6:04 AM
It erases the current loop region.
Bob Denny wrote on 7/31/2008, 4:30 PM
Works perfectly for me. I added code to move it to the start of the timeline. I'm a beginner in all of this...

/**
* Program: ZeroLoopRegion.cs
* Description: This script will remove the loop region and selection in Vegas Pro 8.0
* Author: John Rofrano
*
* Revision Date: May. 19, 2008
* Bob Denny 31-Jul-2008 Move it to the start of the timeline too.
**/

using System;
using Sony.Vegas;

class EntryPoint
{
public void FromVegas(Vegas vegas)
{
vegas.Transport.LoopRegionStart = Timecode.FromNanos(0);
vegas.Transport.LoopRegionLength = Timecode.FromNanos(0);
vegas.Transport.SelectionLength = Timecode.FromNanos(0);
vegas.Transport.SelectionLength = Timecode.FromNanos(0);
}
}