iOps Dispatcher¶
Context-aware dispatch operator that maps a slot key (F1-F5, ESC) plus the current modifier state and editor context to a concrete InteractionOps function. It is the base class every F-key operator inherits from, and the single lookup point that turns "user pressed F2 in UV Edit with Shift" into the correct registered action via IOPS_Dict.
Overview¶
iops.main is the heart of the InteractionOps dispatcher. On invoke it captures the current event.alt / ctrl / shift state, then on execute it builds an 8-tuple query from:
bpy.context.area.typetool_settings.use_uv_select_sync- active object
typeandmode - UV select mode (prefixed
UV_, or replaced by the 3D mesh mode when UV-sync is on) - mesh select mode (
VERT/EDGE/FACE) - the class-level
operatorslot (F1/F2/F3/F4/F5/ESC) - a modifier string (
NONE,ALT,CTRL,SHIFT, or underscore-joined combinations such asALT_CTRL_SHIFT)
That tuple is passed to get_iop(IOPS_Dict.iops_dict, query). If the dictionary returns a callable, it is invoked; otherwise the operator reports No operation defined for this context. With no active area focus it reports Focus your mouse pointer on corresponding window..
The class is not meant to be bound directly; it is subclassed by the F-key slot operators in operators/modes.py and by other dispatch-style operators (e.g. IOPS_OT_CursorOrigin_Mesh) that need the same context-aware behaviour but a different slot value.
Usage¶
- Active area must be focused (the operator early-outs if
bpy.context.areais missing). - An active object in the view layer is preferred; without one the query degrades to area + slot + modifiers and only matches dictionary entries written for that "no object" case.
- Not invoked directly by the user. Trigger via the subclass slot operators:
iops.function_f1...iops.function_f5andiops.function_esc. The default keymap binds these to F1-F5 and Esc respectively, with no modifiers.
Notes¶
iops.mainhas nobl_propsand no UI. All behaviour is data-driven throughutils/iops_dict.pyandutils/functions.get_iop.- Subclasses inherit invoke/execute and only override the
operatorclass attribute (the slot label) andbl_idname/bl_label. Pattern (fromoperators/modes.py):
| bl_idname | Slot | Default key |
|---|---|---|
iops.function_f1 |
F1 | F1 |
iops.function_f2 |
F2 | F2 |
iops.function_f3 |
F3 | F3 |
iops.function_f4 |
F4 | F4 |
iops.function_f5 |
F5 | F5 |
iops.function_esc |
ESC | Esc |
bl_options = {"REGISTER"}only - dispatched calls handle their own undo pushes; the dispatcher itself does not register undo.- The
CURVESobject type inEDIT_CURVESmode is normalised toEDITbefore the query is built, so a single dictionary entry covers both legacy curves and the new Curves object. - When
use_uv_select_syncis on, the UV mode slot is overwritten with the 3D mesh mode so the same dictionary row matches both selection paradigms. - This file registers only
IOPS_OT_Main. The F-key subclasses live inoperators/modes.pyand are registered alongside it from__init__.py.
Related¶
- Modes Slots (F1-F5/ESC)
- iOps Dictionary