INNER CODE UNIT · Python
modal
SpectralVectors/RightMouseNavigation · operators.py:35
def modal(self, context, event):
preferences = context.preferences
addon_prefs = preferences.addons[__package__].preferences
enable_nodes = addon_prefs.enable_for_node_editors
space_type = context.space_data.type
if space_type == "VIEW_3D":
# Check if the Viewport is Perspective or Orthographic
if bpy.context.region_data.is_perspective:
self._ortho = False
else:
self._back_to_ortho = addon_prefs.return_to_ortho_on_exit
# The _finished Boolean acts as a flag to exit the modal loop,
# it is not made True until after the cancel function is called
if self._finished: