DV Info Net

DV Info Net (https://www.dvinfo.net/forum/)
-   What Happens in Vegas... (https://www.dvinfo.net/forum/what-happens-vegas/)
-   -   I Need SnapShot Script Help, Vegas 10 Pro (https://www.dvinfo.net/forum/what-happens-vegas/494327-i-need-snapshot-script-help-vegas-10-pro.html)

Allen Campbell April 8th, 2011 09:37 PM

I Need SnapShot Script Help, Vegas 10 Pro
 
I really hope I am not being a pain. Snap Shots in my work is a major Must Have and will be a large part of my work flow.
I ran a search and did the Google thing.
I have been having problems like, Links not working anymore, forum registration problems, and the ones I did find fail.
I did get some info in a JetDV news letter but it is unclear how to apply it. The documet mostly talks about it.

So........... :-° Any help would be great. I am willing to pay for a working script. Something that would put things back to normal after the shot is taken. I just cannot get my hands on one.

I tried the below in two ways. One saved as a .cs and got the error message.........

System.ApplicationException: Script file does not exist: 'C:\Program Files\Sony\Vegas Pro 10.0\Script Menu\SnapshotToClipboard.js'.
at Sony.Vegas.ScriptHost.LoadScriptText()
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)

And the same file saved as a .js and got the following........

C:\Program Files\Sony\Vegas Pro 10.0\Script Menu\SnapshotToClipboard.js(17) : Variable 'VideoRenderQuality' has not been declared
C:\Program Files\Sony\Vegas Pro 10.0\Script Menu\SnapshotToClipboard.js(21) : Variable 'VideoFieldOrder' has not been declared
C:\Program Files\Sony\Vegas Pro 10.0\Script Menu\SnapshotToClipboard.js(22) : Variable 'VideoDeinterlaceMethod' has not been declared
C:\Program Files\Sony\Vegas Pro 10.0\Script Menu\SnapshotToClipboard.js(25) : Variable 'RenderStatus' has not been declared

===== The Script Text Below =====

// This script copies a snapshot of the current cursor position to the clipboard

import System.Windows.Forms;
import SonicFoundry.Vegas.Script;
import SonicFoundry.Vegas;

// Save original Settings
var origPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
var origPreviewFillSize = Vegas.Project.Preview.FullSize;
var origFieldOrder = Vegas.Project.Video.FieldOrder;
var origProjectDeinterlaceMethod = Vegas.Project.Video.DeinterlaceMethod;

try
{

// Setup Preview for image capture
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;

// Copy Snapshot to Clipboard
Vegas.SaveSnapshot() == RenderStatus.Complete

}
catch (e)
{
MessageBox.Show(e);
}

// Restore Previous Settings
Vegas.Project.Preview.RenderQuality = origPreviewRenderQuality;
Vegas.Project.Preview.FullSize = origPreviewFillSize;
Vegas.Project.Video.FieldOrder = origFieldOrder;
Vegas.Project.Video.DeinterlaceMethod = origProjectDeinterlaceMethod;


// This script copies a snapshot of the current cursor position to the clipboard

import System.Windows.Forms;
import SonicFoundry.Vegas.Script;
import SonicFoundry.Vegas;

// Save original Settings
var origPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
var origPreviewFillSize = Vegas.Project.Preview.FullSize;
var origFieldOrder = Vegas.Project.Video.FieldOrder;
var origProjectDeinterlaceMethod = Vegas.Project.Video.DeinterlaceMethod;

try
{

// Setup Preview for image capture
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;

// Copy Snapshot to Clipboard
Vegas.SaveSnapshot() == RenderStatus.Complete

}
catch (e)
{
MessageBox.Show(e);
}

// Restore Previous Settings
Vegas.Project.Preview.RenderQuality = origPreviewRenderQuality;
Vegas.Project.Preview.FullSize = origPreviewFillSize;
Vegas.Project.Video.FieldOrder = origFieldOrder;
Vegas.Project.Video.DeinterlaceMethod = origProjectDeinterlaceMethod;

Leslie Wand April 8th, 2011 09:49 PM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
version? system?

if you're having other problems to, then i think you'd best start off looking for problems elsewhere - virus, malware, etc.,

Allen Campbell April 8th, 2011 10:55 PM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
Vegas Pro 10c Build 470.
The problems are else where, not with my system but in locating scripts. Many of the links I have searched out are dead. I tried to join a forum and having technical difficulties and the administrators are slow getting back to me. Some scripts like the one I posted are for older versions.

System? Home built by yours truly and heavily maintained, protected and pampered.

Windows 7 Pro x64
Gigabyte Mobo GA-EP45-UD3P
Intel Q6600 CPU - Stock Clock
8GB DDR2 CORSAIR XMS2 DHX - Voltage @ 2.1 (Mfg Recommended)
620W CORSAIR PSU CMPSU-620HX Modular
POWERCOLOR AX3650 512MD2 Radeon HD
WD 750GB RE3 x2 in RAID-1 System OS Drives
WD Black 1TB Media Source Location
WD Blue 1TB Media Rendered Destination
WD Green 750GB Storage
WD RE2 750GB x 2 in RAID 1 External eSATA Box Backups
WD MyBook 500GB USB Misc Storage
Dual Samsung 215TW S-PVA Displays, Pantone EyeOne Display2 Calibrated.

Thanks

Leslie Wand April 9th, 2011 01:26 AM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
obviously you know what you're running ;-)

so if you're using 10c, what happens when you use the snapshot button?

Mike Kujbida April 9th, 2011 05:31 AM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
In Pro 9, Sony added the following features.

* Copy Snapshot to Clipboard and Save Snapshot to File now deinterlace interlaced images and operate at Best (Full) resolution if the Video Preview is set to (Auto) size and Good quality if set to Draft or Preview.
* Copy Snapshot to Clipboard now performs pixel-aspect correction like the Save Snapshot to File command.
* Added Copy Snapshot to Clipboard and Save Snapshot to File to the Trimmer.

A roundabout way of saying don't worry about having to change anything.

Edward Troxel April 9th, 2011 01:47 PM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
The script you're using is a ".js" script. If you seem "import" - it's a js.

Here's my version for Vegas Pro 8:

Code:

/*******************************************
 * This script will save a snapshot from the timeline
 *
 * Written By: Edward Troxel - partially modified from the script by Joe Satcher
 * www.jetdv.com
 *******************************************/

import System;
import System.IO;
import System.Windows.Forms;
import Sony.Vegas;

// Where should the file be saved?
var destdir = "C:\\";

// What is the file name?
var destname = "MyPic";


// Save the current settings
var origPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
var origPreviewFillSize = Vegas.Project.Preview.FullSize;
var origFieldOrder = Vegas.Project.Video.FieldOrder;
var origProjectDeinterlaceMethod = Vegas.Project.Video.DeinterlaceMethod;
var currentTime = Vegas.Cursor;


try {
  var imageFileName = destdir + destname + ".png";


  // Set for the best quality.
  Vegas.Project.Preview.RenderQuality = VideoRenderQuality.Best;
  Vegas.Project.Preview.FullSize = true;
  Vegas.Project.Video.FieldOrder = VideoFieldOrder.ProgressiveScan;
  Vegas.Project.Video.DeinterlaceMethod = VideoDeinterlaceMethod.InterpolateFields;

Vegas.UpdateUI();

  // Show the script's dialog box.
  var dialog = new SaveFileDialog();
  dialog.Filter = "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg";
  dialog.CheckPathExists = true;
  dialog.AddExtension = true;
  if (Directory.Exists(destdir)) {
    dialog.InitialDirectory = destdir;
  }
  dialog.DefaultExt = Path.GetExtension(imageFileName);
  dialog.FileName = Path.GetFileNameWithoutExtension(imageFileName);

  // if the OK button was pressed...
  if (dialog.ShowDialog() == DialogResult.OK) {
  // Get the basis for output image file names
    imageFileName = Path.GetFullPath(dialog.FileName);

    // Get the output image file name extension
    var imageFileNameExt = Path.GetExtension(imageFileName);
    var imageFormat = ImageFileFormat.PNG;
    if (0 == String.Compare(imageFileNameExt, ".jpg", true)) {
      imageFormat = ImageFileFormat.JPEG;
    }

    // save a snapshot.
    if (Vegas.SaveSnapshot(imageFileName, imageFormat, Vegas.Cursor) == RenderStatus.Complete) {
      Vegas.UpdateUI();
    }
  }
} catch (e) {
  MessageBox.Show(e);
}

// 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;


Allen Campbell April 9th, 2011 02:19 PM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
Thanks Ed, You said js twice. Just to confirm, its a .js yes?

Also, you get my PMe?

Thanks

Edward Troxel April 9th, 2011 02:21 PM

Re: I Need SnapShot Script Help, Vegas 10 Pro
 
Yes, .JS (as this one says "import". If you see the word "using" instead, it's a .CS.

And yes I did, and responded to it.


All times are GMT -6. The time now is 02:21 PM.

DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network