Your Ad Here

Getting and Changing the Current Frame

The current frame value is contained in a parameter named Current and can be accessed directly, via the GetValue and SetValue commands (as discussed in Accessing Parameter Values Directly) or through the OM Parameter object and the C++ API Parameter class, as demonstrated in the examples below.

Parameters are available from the Property object and the Property class (see Accessing the PlayControl Property Set for details on how to get a pointer to the PlayControl property).

VBScript Example: Getting the Current Frame

' VBScript (command access)
dim curr_frame
curr_frame = GetValue( "PlayControl.Current" ) ' GetValue only returns data values for Parameters

' Go to frame 10, and then the last frame
SetValue "PlayControl.Current", 10.0 
SetValue "PlayControl.Current", GetValue( "PlayControl.Out" )

JScript Example: Getting the Current Frame

// JScript (object model access)
var remote_control = ActiveProject.Properties( "PlayControl" );
var curr_frame = remote_control.Parameters( "Current" ); // returns a pointer to the specified Parameter

// Find out what the current frame is
Application.LogMessage( "Current frame: " + curr_frame.Value );

// Go to frame 10, and then the last frame
curr_frame.Value = 10.0;
curr_frame.Value = remote_control.Parameters( "Out" ).Value;



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index


Your Ad Here