I’m looking for the correct code snipped to set the main 3D view to Camera view, said snippet to run from any python including the python console.
The offered python from the View/Camera tooltip is
but it produces an error:
Traceback (most recent call last):
File “<blender_console>”, line 1, in <module>
File “/Applications/blender-2.57b-OSX_10.5_x86_64/blender.app/Contents/MacOS/2.57/scripts/modules/bpy/ops.py”, line 179, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.view3d.viewnumpad.poll() expected a view3d region
It seems likely this is because there might be more than one view3d, but there has to be a way to control this for ops, right?