1
$\begingroup$

I'm not sure what's the right word, but I would like to manipulate the camera you see from with python BPY.

I know there are 2 cameras on startup. One camera you render from, and another camera you use to navigate around with in the scene. How do you change parameters such as position on the navigation camera?

$\endgroup$
3

1 Answer 1

1
$\begingroup$

I don't think Blender treats the perspective or any other view like an actual camera, unlike Maya.

You can set your current scene's camera to your current view using ⎈ Ctrl⎇ Alt0 or using the python command bpy.ops.view3d.camera_to_view(), though it requires to be run from the context of the 3D Viewport so it will look more like this:

import bpy
 
areas3d  = [area for area in bpy.context.window.screen.areas if area.type == 'VIEW_3D']
bpy.ops.view3d.camera_to_view({'area':areas3d[0]})

More about it: scripting - Align active camera to view using python - Blender Stack Exchange

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .