Post #3488:
Ph
📋 Metadata
- Author: roaoao
- Date: 2020-08-01 14:53:44
- Type:
answer - Quality Score: 9/10
- Reply to: post_03486
- Replies (1): post_03490
🏷️ Tags
⚙️ Related PME Features
- 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