Post #508: ![](https://blenderartists.org/user_avatar/blenderartists.org/rhyging5/48/725092

📋 Metadata

🏷️ Tags

hotkeys conflicts pie-menu intermediate

  • Stack Key Editor
  • Pie Menu Editor
  • Python Scripting
  • Hotkey Configuration

💬 Content

rhyging5:

hello roaoao,

when working in weight paint, many often, a mesh and armature are selected at the same time. So here there is a conflict opening menus with the same keypressed but diferents contexts ( weight paint context vs. pose context menu).

Despite the mesh is the real one selected and the armature is only active (and in pose mode), the code gives priority to opening the pose context menu instead the weight paint context menu in the weight paint mode, which is not the ideal.

I know that is not a big deal. Some solution would be to change the keymap. But maybe is possible to solve that kind of conflict easily.

thanks and regards!

Hi, rhyging5.
Yes, looks like Blender gives priority to Pose mode in this case.
But you can create context sensitive menu using Stack Key with one command.
Let’s say you have “Pose Menu” and “Weight Paint Menu”:

  1. Remove their hotkeys using X button.

  2. Add a new Stack Key.

  3. Add Pose and Weight Paint keymaps for it.

  4. Use this code in Command tab to open “Weight Paint Menu” in Weight Paint mode and “Pose Menu” in Pose mode :

open_menu("Weight Paint Menu") if C.active_object.type == 'MESH' else open_menu("Pose Menu")

🔗 View on Blender Artists