Undo Python Script

In this situation (since you’re not setting properties directly via set_editor_property) you need to call modify on the object before you change it, as this notifies the transaction system that it is going to change and needs to be tracked. We could perhaps do this automatically when calling non-pure methods on an object from Python.

Which version of UE4 are you using. I think this was only added in 4.21.