CaptureViewport

Introduced

v1.0

Categories

viewing

Description

Captures the viewport into an image sequence.

Note: This command does not work in normal batch mode because it relies on the Softimage user interface. However you can use the "-uiscript" command line argument instead of "-script" to use this command as part of a batch process.

Scripting Syntax

CaptureViewport( [Target], [Interactive] );

Parameters

Parameter Type Description
Target Long Viewport to capture.

Default Value: -1 (the current viewport, or viewport B if no current viewport)

Possible Values:

Description:

-1 The current viewport (under the cursor)
1 Viewport A
2 Viewport B
3 Viewport C
4 Viewport D
Interactive Boolean Specifies whether running in batch mode (False) or interactive mode (True)

Default Value: False

Examples

1. JScript Example

/*
        This example demonstrates how to perform a viewport capture via scripting.
        NB: You cannot set the codec from scripting. The codec is a combination of codec ID and 
        private codec-specific parameters (not a human-readable string). However, you can save
        the codec in a preset via the UI and then load the preset back by scripting anytime you need it.
*/
// Get the current frame
var currFrame = ActiveProject.Properties.Item("Play Control").Parameters.Item("Current").Value;
// Set the capture options
var oViewportCapture = Dictionary.GetObject("ViewportCapture");
// Capture a 1-frame sequence 
oViewportCapture.NestedObjects.Item("Start Frame").Value = currFrame;
oViewportCapture.NestedObjects.Item("End Frame").Value = currFrame;         
// Specify the output file name
// The output file format is determined by the extension
oViewportCapture.NestedObjects.Item("File Name").Value = "C:\\test.pic";
// Do not display dialog
CaptureViewport( 2, false );

2. VBScript Example

CreatePrim "Sphere", "NurbsSurface", "MySphere"
SetValue "PlayControl.Out", 40
' Setting a key frame on XPos at frame 1
SaveKey "MySphere.kine.local.posx", 1, -9.0
' Setting a key frame on XPos at frame 10
SaveKey "MySphere.kine.local.posx", 10, 3.0
' Setting a key frame on XPos at frame 30
SaveKey "MySphere.kine.local.posx", 30,-3.0
' Setting a key frame on XPos at frame 40
SaveKey "MySphere.kine.local.posx", 40, 9.0
' Setting a key frame on YPos at frame 1
SaveKey "MySphere.kine.local.posy", 1, -2.0
' Setting a key frame on YPos at frame 30
SaveKey "MySphere.kine.local.posy", 30, 2.0
SetDisplayMode "Camera", "shaded"
CaptureViewport 2, true

See Also

Flipbook Viewport Capture parameters