Currently, since workspacetool + modal operator have too much restrictions, the only way which i was manage to found to have a tool which will do some “preselect-highlight” with ability to run some modal operator on clicks - is gizmo classes.
The one addon which use it is Snap Utility Line
The code is too big for my current level, so i was try to analyze it with a help of GPT and it was sounds like the answer, since code have some routine to check if mesh data … Until i actually try to use this addon and check the console:
If we activate the tool, decided what we need more geometry (just as an example), select all, run subdivide operator, for most of the cases we actually will get →
Errors
Traceback (most recent call last):
File “C:\Users\alexa\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\rmKit\addon\exportmanager.py”, line 78, in on_depsgraph_update
sync_scene_with_export_manager( scene )
File “C:\Users\alexa\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\user_default\rmKit\addon\exportmanager.py”, line 46, in sync_scene_with_export_manager
scene.em_propertygroup.export_items.clear()
AttributeError: Writing to ID classes in this context is not allowed: Scene, Scene datablock, error setting EM_PropertyGroup.
Traceback (most recent call last):
File “C:\Users\alexa\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\blender_org\snap_utilities_line\widgets.py”, line 117, in test_select
self.update_snap(context, mval)
File “C:\Users\alexa\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\blender_org\snap_utilities_line\widgets.py”, line 100, in update_snap
self.snap_obj, prev_loc, self.location, self.type, self.bm, self.geom, len = snap_utilities(
^^^^^^^^^^^^^^^
File “C:\Users\alexa\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\blender_org\snap_utilities_line\common_utilities.py”, line 180, in snap_utilities
snp_obj, loc, elem, elem_co, view_vector, orig, bm, bm_geom = get_snap_bm_geom(
^^^^^^^^^^^^^^^^^
File “C:\Users\alexa\AppData\Roaming\Blender Foundation\Blender\4.2\extensions\blender_org\snap_utilities_line\common_utilities.py”, line 115, in get_snap_bm_geom
r_bm.verts[r_elem[0]],
~~~~~~~~~~^^^^^^^^^^^
IndexError: BMElemSeq[index]: outdated internal index table, run ensure_lookup_table() first
Maybe someone know some addons/code examples where such issues was solved?