Post #3488: Ph

📋 Metadata

🏷️ Tags

stack-key hotkeys advanced

  • Stack Key Editor
  • Python Scripting

💬 Content

Phazor:

Is there a way to make a dynamic stack key that toggles between a specified tool and the last selected tool you had before choosing that tool?

Yes, here is the code for a stack key:

tool_id = "builtin.select_box"; tool = C.workspace.tools.from_space_view3d_mode(C.mode); tool_id = getattr(pme, "prev_tool", tool_id) if tool_id == tool.idname else tool_id; setattr(pme, "prev_tool", tool.idname); bpy.ops.wm.tool_set_by_id(name=tool_id)

❤️ 3 likes


🔗 View on Blender Artists