Can someone make this script for $20?

andrewcg wrote on 8/28/2020, 9:12 PM

Hello all, I use Vegas' save screenshot feature a lot. I use several fx including Neat Video which is very slow to scrub at "Best Quality" preview. As far as I know, I must have "Best Quality" to have Vegas save screenshot at my 4K project setting resolution. So I had to keep turn on/off "Bypass fx" and "Best Quality" preview as I scrubbed and took screenshots. My finger is killing me and I'm worried I'll develop carpal tunnel or something like that. Can anyone make a script with the following command?

1. Turn off "Bypass Fx" in Preview Window

2. Set Preview Window to "Best Full Quality"

3. Save screenshot as JPG to file to C:\Capture

4. Set Preview Window back to "Preview Full Quality"

5. Turn on "Bypass Fx" in Preview Window

Thanks!

Andrew

 

Comments

wwaag wrote on 8/28/2020, 10:38 PM

I already have a number of Snapshot scripts in my FreeTools library at https://tools4vegas.com/library/ It's listed under Snapshot Tools. At the moment, it doesn't bypass and enable Fx, and it saves to a subfolder of the project file, but you may find it useful to try and it's free. Bypassing and enabling Fx on the output bus would only require a few extra lines of code.

andrewcg wrote on 8/28/2020, 11:22 PM

Thanks for the guide! It's definitely a good starting point for me.

jetdv wrote on 8/29/2020, 3:01 PM

I do not see a way in scripting to turn on/off Split Screen Mode (is that what you're referring to by "Turn off "Bypass Fx" in Preview Window"?

 

Change the project to Best/Full

myVegas.Project.Preview.RenderQuality = VideoRenderQuality.Best ;
myVegas.Project.Preview.FullSize = true;

 

Then this code will save a snapshot:

myVegas.SaveSnapshot(FullFileName, ImageFileFormat.JPEG, CurrTC)

 

Change the project to Preview/Auto

myVegas.Project.Preview.RenderQuality = VideoRenderQuality.Preview ;
myVegas.Project.Preview.FullSize = false;

 

Here's how I have typically done it:
 

        // save original project and preview settings
        VideoRenderQuality origPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
        bool origPreviewFillSize = Vegas.Project.Preview.FullSize;
        VideoFieldOrder origFieldOrder = Vegas.Project.Video.FieldOrder;
        VideoDeinterlaceMethod origProjectDeinterlaceMethod = Vegas.Project.Video.DeinterlaceMethod;

        // Set the preview quality and size.
        Vegas.Project.Preview.RenderQuality = VideoRenderQuality.Best;
        Vegas.Project.Preview.FullSize = true;
        // Set the field order and deinterlace method
        Vegas.Project.Video.FieldOrder = VideoFieldOrder.ProgressiveScan;
        Vegas.Project.Video.DeinterlaceMethod = VideoDeinterlaceMethod.InterpolateFields;

        Vegas.UpdateUI();
          
        FullFileName = FilePath + "filename.jpg";
        if (Vegas.SaveSnapshot(FullFileName, ImageFileFormat.JPEG, CurrTC) == RenderStatus.Complete) 
          {
            Vegas.UpdateUI();
          }
          i++;
        }

        // restore the project and preview settings
        Vegas.Project.Preview.RenderQuality = origPreviewRenderQuality;
        Vegas.Project.Preview.FullSize = origPreviewFillSize;
        Vegas.Project.Video.FieldOrder = origFieldOrder;
        Vegas.Project.Video.DeinterlaceMethod = origProjectDeinterlaceMethod;

 

andrewcg wrote on 8/29/2020, 3:53 PM

I do not see a way in scripting to turn on/off Split Screen Mode (is that what you're referring to by "Turn off "Bypass Fx" in Preview Window"?

Yes, that's what I meant. That's too bad. Oh well, happyotter's savesnapshot script does help me from changing the preview window quality all the time.

I saved the script above as .cs and got this error when I applied it in Vegas.

andrewcg wrote on 8/29/2020, 4:20 PM

Thanks wwaag and jetdv for your help! My scripting skills is limited to copy/paste in notepad so you have been extremely helpful. I'm using happyotter's snapshot script at https://tools4vegas.com/snapshot-tools/

jetdv wrote on 8/30/2020, 7:00 AM

That was just a code segment - it was not a complete script which would be why you are getting an error. The complete script would be something more like this:

using ScriptPortal.Vegas;

public class EntryPoint
{
    Vegas myVegas;
    
    public void FromVegas(Vegas vegas)
    {
        myVegas = vegas;
        // save original project and preview settings
        VideoRenderQuality origPreviewRenderQuality = myVegas.Project.Preview.RenderQuality;
        bool origPreviewFillSize = myVegas.Project.Preview.FullSize;
        VideoFieldOrder origFieldOrder = myVegas.Project.Video.FieldOrder;
        VideoDeinterlaceMethod origProjectDeinterlaceMethod = myVegas.Project.Video.DeinterlaceMethod;

        // Set the preview quality and size.
        myVegas.Project.Preview.RenderQuality = VideoRenderQuality.Best;
        myVegas.Project.Preview.FullSize = true;
        // Set the field order and deinterlace method
        myVegas.Project.Video.FieldOrder = VideoFieldOrder.ProgressiveScan;
        myVegas.Project.Video.DeinterlaceMethod = VideoDeinterlaceMethod.InterpolateFields;

        myVegas.UpdateUI();
          
        FullFileName = FilePath + "filename.jpg";
        if (myVegas.SaveSnapshot(FullFileName, ImageFileFormat.JPEG, CurrTC) == RenderStatus.Complete) 
        {
          myVegas.UpdateUI();
        }

        // restore the project and preview settings
        myVegas.Project.Preview.RenderQuality = origPreviewRenderQuality;
        myVegas.Project.Preview.FullSize = origPreviewFillSize;
        myVegas.Project.Video.FieldOrder = origFieldOrder;
        myVegas.Project.Video.DeinterlaceMethod = origProjectDeinterlaceMethod;
    }
}

 

 

Tim L wrote on 8/30/2020, 9:53 AM

Edward (@jetdv) -- I'm not a script guy, and I haven't tried to run this script, but your source code blocks seem (visually) to have a missing opening brace to match the closing after "i++;". Is the snapshot action actually supposed to be inside a loop? I presume "i" needs a declaration -- probably done by the missing loop control statement?

andrewcg wrote on 8/30/2020, 11:05 AM

That was just a code segment - it was not a complete script which would be why you are getting an error. The complete script would be something more like this:

Thanks! I probably should learn some scripting someday. It comes in handy to make things easier :-)

jetdv wrote on 8/31/2020, 9:45 AM

@Tim L, the i++ should not be there. The code I pulled it from was, indeed, in a loop. I was just trying to give an example and did not try to run the actual code segment above. I know each piece works because that is what I'm using in Excalibur but I did rip out some of the code and, apparently, missed that i++ in the process. So just delete that one line and the line after it (the } after it should also not be there) and it ought to work. I'll update the post above to remove those two lines.