import bpy
name = "text1"
t1 = bpy.data.curves.new(name, 'FONT')
o1 = bpy.data.objects.new(name, t1)
o1.location = (0,0,2)
bpy.context.scene.objects.link(o1)
t1.body = "Hail Bob!"
c1 = o1.constraints.new('TRACK_TO')
c1.target = bpy.data.objects["Camera"]
c1.track_axis = 'TRACK_Z'
c1.up_axis = 'UP_Y'
if False:
t1.align = 'RIGHT'
else:
bpy.context.scene.update()
print (o1.dimensions.x)
t1.text_boxes[0].x = o1.dimensions.x * -0.3
|
Blender python API quick-start
Syntax highlighting by Pygments.