Post #5599: That’s a good idea.

📋 Metadata

🏷️ Tags

macro hotkeys advanced

  • Macro Editor
  • Python Scripting

💬 Content

That’s a good idea.
However, you’re confusing it with bpy.ops.
With bpy.ops, you can control the undo flag with a boolean argument.

bpy.ops.some_operator('INVOKE_DEFAULT', False)

https://docs.blender.org/api/current/bpy.ops.html#keywords-and-positional-arguments

But execute_script() is not bpy.ops, it’s a utility within PME. It simply executes a script and returns True.

As an advanced technique, if you want to call a PME macro without undo, it would be like this:

bpy.ops.pme.macro_something(False, PME_OT_macro_exec1={"cmd":"execute_script(\"foo.py\")"})

🔗 View on Blender Artists