import bpy
import math
name = "cam"
cam = bpy.data.cameras.new(name)
obj = bpy.data.objects.new(name, cam)
bpy.context.scene.objects.link(obj)
obj.location = (0,10,0)
obj.rotation_euler = (-math.pi/2,math.pi,0)
bpy.context.scene.camera = obj
|
Blender python API quick-start
Syntax highlighting by Pygments.