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:
bpy.ops.gpencil.my_operator()
bpy.ops.gpencil.my_operator('INVOKE_DEFAULT')
bpy.ops.gpencil.my_operator('EXEC_DEFAULT')
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