Hello folks I'm trying to execute an operator from code (like calling bpy.ops.my_operator()) and I'd like to show its UNDO-REDO panel.

(The OT's panel is showing as expected when I execute the operator via search-bar or via button in the UI, it has the UNDO option).

I need to call my_operator from a diferent operator (explained below why*) (lets call it my_other_operator). my_other_operator has not the UNDO option, by the way.

I've tried:


But none of them work, they all execute the operator but they don't show the UNDO panel anymore.

Any idea how to show the menu again?

*If someone wants to know the context, I'm using different curves and color ramps that I get from a material. I can't show them in the OT's UNDO panel, and since the UNDO deletes their changes, I've made a "Re-Execute" operator that makes a backup of the values, handles the undo, and calls the operator again (so I would like to make the panel visible again).

Thank you so much for the help


1 Answer 1


Yes, it's possible. To get this functionality you should add the 'UNDO' key word to your operator's 'bl_options'.

  • In the Blender's text editor there are a plenty of templates. Check out the one called "Operator Mesh Add". You can find it HERE:


  • And there you can see an example how to implemented the UNDO :


  • If you want to have a deeper understanding of this topic I can recommend you the Blender's official tutorial which is called "Your Own Operator -- Scripting for Artists" [=link_to_youtube=]

  • $\begingroup$ Thanks for the help mate. Yeah, I said in my post that I set the UNDO bl_option, but what I meant is how to make the menu appear when I call the operator from code (the menu shows as expected when I execute the operator as usual). Sorry if I didn't expres myself correctly $\endgroup$
    – Ommadawn
    Commented Feb 6 at 23:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .