Redo
 
 
 

Redo

Introduced

v4.2

Description

Redoes the last command that was undone in the command stack. This is the scripting equivalent of selecting Redo from the main Edit menu or pressing Ctrl+Y in the user interface.

Note: Redo is only available after an Undo operation.

Warning: Don't call this command to undo changes to scene data from a custom command. Custom commands are only allowed to use the Undo and Redo commands for user data. For more information, see Undoing and Redoing Custom Commands.

Scripting Syntax

Redo( [Repetitions] );

Parameters

Parameter Type Description
Repetitions Integer Number of times to redo. May stop earlier if there are no more commands to redo.

Default Value: 1

Examples

JScript Example

/*
        This example demonstrates how to use the Redo option in scripting by 
        using the DataRepository (internal object database) to see whether
        the object exists in the scene at each step (creating the object, 
        deleting, undoing, and then redoing the DeleteObj call)
*/
NewScene( null, false );
var odb = XSIUtils.DataRepository;
var object2kill = CreatePrim( "Cone", "MeshSurface" )
obj_id = odb.GetIdentifier( object2kill )
LogMessage( odb.HasData(obj_id) );
//INFO : True
DeleteObj( object2kill );
LogMessage( odb.HasData(obj_id) );
//INFO : False
Undo();
LogMessage( odb.HasData(obj_id) );
//INFO : True
Redo();
LogMessage( odb.HasData(obj_id) );
//INFO : False

See Also

Undo