Eyeon:Script/Reference/Applications/Fusion/Classes/Composition/StartUndo

From VFXPedia

Jump to: navigation, search

Contents

Composition : StartUndo

Arguments

StartUndo( name )

  • name(required, string)

the name argument specifies the name displayed in the Edit/Undo menu of the Fusion GUI a string containing the complete path and name of the composition to be saved.

Returns

This function does not return a value.

Remarks

The StartUndo() function is always paired with an EndUndo() function. Any changes made to the composition by the lines of script between StartUndo() and EndUndo() are stored as a single Undo event.

Changes captured in the undo event can be undone from the GUI using CTRL-Z, or the Edit menu. They can also be undone from script, by calling the Undo function. If the script exits before the EndUndo() is called Fusion will automatically close the undo event.

Requirements

  • eyeonScript 5.0
  • Fusion 5.0

Examples

fusion = Fusion("127.0.0.1")
 
composition = composition:NewComp()
 
SetActiveComp(comp)
 
composition:StartUndo("Add some tools")
 
bg1 = Background{}
 
pl1 = Plasma{}
 
mg1 = Merge{ Background = bg1, Foreground = pl1 }
 
composition:EndUndo(true)


Tips for StartUndo (edit)

Note: Actual changes must be made to the composition (forcing a "dirty" event) before the undo will be added to the stack. For example, this:

   composition:StartUndo("Testing.")  print("This is a test.")  composition:EndUndo()

won't add an undo to the list, but this:

   composition:StartUndo("Testing.")  ld = Loader()  composition:EndUndo()

will -- and you'll see it show up in the Edit menu as an undo action. This caused me some confusion, so adding it here.