I created an addon that can let you do this. install just like any addon. Then under n-panel->view tab->View panel->View Lock sub panel there is a new option: Lock View Rotation. Check it to turn off view rotation.
You can download it here: https://drive.google.com/file/d/1NeFhsj3A3ZaSQY2eu1HGYE_K8V-RvPLA/view?usp=sharing
Or Cut and paste it into Blender’s text editor and save with a [name].py Make sure to have the period py at the end. Then you can install that python file as an addon.
bl_info = {
"name": "Lock View Rotation",
"blender": (4, 0, 0),
"category": "3D View",
}
import bpy
def draw_lock_rotation(self, context):
layout = self.layout
col = layout.column(align=True)
col.prop(context.space_data.region_3d, "lock_rotation", text="Lock View Rotation")
def register():
bpy.types.VIEW3D_PT_view3d_lock.append(draw_lock_rotation)
def unregister():
bpy.types.VIEW3D_PT_view3d_lock.remove(draw_lock_rotation)
if __name__ == "__main__":
register()
***Edit** Thanks to BlenderArtist.org for helping me figure out how to append it to the existing panel. Thanks to Martin(AKA Spikey) for pointing me in the right direction.(See previous post)