View > Perspective/Orthographic (Numpad 5) allows you to toggle between them. I'd like to specify Ortho without toggling, using python.
Here is what I have so far:
def execute(self, context):
# Switch to orthographic view
bpy.ops.view3d.view_axis(type='RIGHT')
bpy.ops.view3d.view_perspective(type='ORTHO')
Which doesn't entirely work. I was checking out this thread, and I'm unable to get the recommendation for setting to Ortho to work either:
space.region_3d.view_perspective = 'ORTHO'
I get a space needs to be defined error, but I don't know if that's exactly what I need anyways. Any thoughts?