Question

Can one hotkey show a Geometry Nodes pie without also showing it in Shader Editor or Compositor?

Answer

Yes. Give each menu a Poll method that returns True only for its Node Editor subtype. PME will not invoke a menu whose Poll returns False.

For a Geometry Nodes menu:

return C.area and C.area.ui_type == "GeometryNodeTree"

Make separate menus for the other node editors rather than trying to put every tool into one large menu:

# Shader Editor
return C.area and C.area.ui_type == "ShaderNodeTree"
 
# Compositor
return C.area and C.area.ui_type == "CompositorNodeTree"

The Poll method field used for a node-editor-specific menu

Set it up

  1. Create the Geometry, Shader, or Compositor menu as usual.
  2. Open that menu’s advanced settings and enter the matching expression in Poll.
  3. Return a boolean. return is required; writing only the comparison does not make a Poll result.
  4. Bind the menus to the same hotkey only after each one works independently in its intended editor.

The test is deliberately local to the active area. A Geometry Nodes editor open elsewhere on the screen does not make the menu eligible under the cursor.

Pitfalls

  • C.area.type == "NODE_EDITOR" is too broad: it cannot distinguish Geometry Nodes from Shader Editor.
  • Keep the C.area guard so the Poll fails closed when no Blender area is available.
  • A Poll only decides whether the menu is available. Its commands still need their own valid Blender context.
  • Python needs ordinary quote characters (" or '); smart quotes copied from formatted text cause a syntax error.
  • Keep a general Node Editor menu without this Poll when some tools really are shared.

Sources