Hi
It seems like the currently selected vertex is not registered by the time when a mouse is clicked to select if the operator is modal. I am wondering what the proper way to do this is.
Here is a sample code. In this example, the Cursor moves to the selected vertex after a second click, this click can be done on another component or the viewport, it seems to require some kind of update I assume. So when the user clicks on vertex the cursor does not moved to that one immeidately.
#Assumes the user clicks on a componnet
if event.type == 'LEFTMOUSE':
print("Left mouse")
if context.object.mode=='EDIT':
bpy.ops.view3d.snap_cursor_to_selected()
return {'PASS_THROUGH'}
thanks