The description here seems very clearly, but my test code is not working.
The undo entry “My Transaction Test” is in the Undo-History, but it is not undoing the translation.
Anyone can help?
import unreal
actors = unreal.EditorLevelLibrary.get_selected_level_actors()
location = actors[0].get_actor_location()
with unreal.ScopedEditorTransaction("My Transaction Test") as trans:
location.z += 28
actors[0].set_actor_location(location, False, True)
Maybe I have to explicit set the enter and exit points of the commands to undo?
https://api.unrealengine.com/INT/PythonAPI/class/ScopedEditorTransaction.html?highlight=scoped