INNER CODE UNIT · Python
reset_cursor
SpectralVectors/RightMouseNavigation · operators.py:53
def reset_cursor():
# Reset blender window cursor to previous position
area = context.area
x = area.x
y = area.y
x += int(area.width / 2)
y += int(area.height / 2)
bpy.context.window.cursor_warp(x, y)
if self._callMenu:
# Always reset the cursor if menu is called, as that implies a canceled navigation
if addon_prefs.reset_cursor_on_exit and not space_type == "NODE_EDITOR":
reset_cursor()
self.callMenu(context)
else:
# Exit of a full navigation. Only reset the cursor if the preference is enabled
if addon_prefs.reset_cursor_on_exit:
reset_cursor()