For any given Tool button that has the little triangle in the lower right, is there a standard way to cycle thru the options for that Tool via the keyboard ?
For instance, in Photoshop this is accomplished by hitting the hotkey+Shift for that tool repeatedly.
(IMO the SHIFT is overkill: if a tool is already selected, simply hitting the hotkey again should be adequate.)
DerekWatts
(DerekWatts)
January 15, 2020, 10:51pm
2
Yep, assign your hotkey and check the ‘cycle’ box.
You can use this add-on, which creates an operator that cycles currently active tool:
bl_info = {
"name": "Cycle Active Tool",
"author": "Stan_Pancakes",
"version": (1, 0, 0),
"description": "",
"blender": (2, 80, 0),
"location": "",
"warning": "",
"category": "Interface",
}
import bpy
class CycleActiveTool(bpy.types.Operator):
bl_idname = "wm.cycle_active_tool"
bl_label = "Cycle Active Tool"
@classmethod
def poll(cls, context):
type = context.area.type
return type == 'VIEW_3D' or type == 'NODE_EDITOR' or type == 'IMAGE_EDITOR'
def execute(self, context):
area_type = context.area.type
tools = context.workspace.tools
id = None
if area_type == 'VIEW_3D':
id = tools.from_space_view3d_mode(context.mode, create=False).idname
elif area_type == 'NODE_EDITOR':
id = tools.from_space_node(create=False).idname
elif area_type == 'IMAGE_EDITOR':
id = tools.from_space_image_mode(context.area.ui_type, create=False).idname
if not id:
return {'CANCELLED'}
return bpy.ops.wm.tool_set_by_id(name=id, cycle=True)
def register():
bpy.utils.register_class(CycleActiveTool)
def unregister():
bpy.utils.unregister_class(CycleActiveTool)
and then assign hotkeys in 3D View (Global), Image → UV Editor and Node Editor. For example, like this:
William
(William)
January 15, 2020, 11:17pm
4
The Industry Compatible keymap is already set up this way. The built-in keymap also works like this - press W repeatedly to cycle selection tools.