Adding an operator to the Undo History list

Commonly, when a user executes an operator in Blender, this event is automatically recorded in the “Undo History” list so that in the future he can quickly undo the execution of the operator (Ctrl + z) or execute it again – redo the operator execution (Ctrl + shift + z). However, this does not always work.

Author: Andrej.

Let’s execute the simplest “Add Cube” operator to add the cube mesh to the scene in the Python Console:

Then, if we check the Undo History list (Edit – Undo History in the main menu), we will see that the execution of the operator itself was not included in the undo list, but only the general “Console Execute” action.

If we need for the statement itself to also be included in the Undo History list, we need to execute it by passing the “True” value to its first implicit parameter:

Now, the call of the operator itself is also recorded in the Undo History list.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments