Returns True is undos are currently enabled.
Returns a context manager, within which changes to Houdini will not be added to the undo stack.
with hou.undos.disabler(): # Move all object nodes 1 unit to the left. # This cannot be undone! for n in hou.node("/obj").children(): n.move(hou.Vector2(-1, 0))
Returns a context manager, within which all changes to Houdini are recorded as a single action on the undo stack.
with hou.undos.group("Move all nodes to the left"): # Move all object nodes 1 unit to the left. # This is for n in hou.node("/obj").children(): n.move(hou.Vector2(-1, 0))
This has no effect when run inside parameter callback scripts because they are already executed within an undo group.
editor argument is a hou.NetworkEditor object should be used when the undo group is being created as part of executing an action inside a Network View pane that might contain APEX Nodes. This ensures that edits to the APEX graph are only saved to the current SOP when all operations inside the undo group have been completed.
Clear all undo and redo information.
add(undo, label, tag=None)
Add an undo operation to the undo history.
undo must be an object
with undo() and redo() methods. The undo() method is executed when the
operation is undone and the redo() method is executed when the operation
label is a description of the undo operation as it appears in the undo
A hou.OperationFailed is raised if the
undo object passed
in does not have an undo() method or a redo() method.
For example, a valid python object passed to this function would look like:
class MyUndoClass(): def __init__(self): # ... Initialization ... pass def undo(self): # Add in what needs to be done on undo pass def redo(self): # Add in what needs to be done on redo pass
Using the above class, a call to this function would look like:
foo = MyUndoClass() hou.undos.add(foo, "My Undo")
An optional string tag can also be set for this undo object, which will allow it to be removed from the undo stack using hou.undos.removeUndos.
foo = MyUndoClass() hou.undos.add(foo, "My Undo", "myTag")
Invalidates and removes all undos that are tagged with
# Removes all undos with the tag "myTag" hou.undos.removeUndos("myTag")
The current memory used (in bytes) for undos.
The maximum allowed memory usage size (in bytes) for undos.
Undo the last action.
Redo the last undoed action.
→ tuple of
Provides a tuple of the undo operations currently on the stack. Note that the first item (ie. undoLabels()/hom/hou/0.html) is the next operation that will be undone.
→ tuple of
Provides a tuple of the redo operations currently on the stack. Note that the first item (ie. redoLabels()/hom/hou/0.html) is the next operation that will be redone.