Post #3606: Hi @anminmakura,

πŸ“‹ Metadata

🏷️ Tags

macro pie-menu context-errors intermediate solved

  • Macro Editor
  • Pie Menu Editor
  • Python Scripting
  • Command execution
  • Invoke and Undo Flag options

πŸ’¬ Content

Hi @anminmakura,

anminmakura:

I also get the following error.

RuntimeError: Operator failed, context is incorrect

This error means that some operation in your macro requires different context. Eg. Subdivide tool requires Edit mode.

I suggest to split your Arch Face tool into 2 steps:
1 step (Object Mode): Add a plane and go to Edit mode.
2 step (Edit Mode): Call Arch Face macro.

Here is Arch Face macro

To call both steps using a single button use this code in Command tab:

bpy.ops.mesh.primitive_plane_add(enter_editmode=True); open_menu("Arch Face")

anminmakura:

How do I modify the Subdivide menu so that the screen.redo_last parameter manipulation can reflect the menu registered after it?

To be able to manipulate parameters of an operation (eg. Subdivide) you need to add it to the macro with Invoke and Undo Flag options:

img_operator_editor

If you don’t want to manipulate them use Exec option instead of Invoke.


❀️ 3 likes


πŸ”— View on Blender Artists