I use blender 2.6 and add a text object with
bpy.ops.object.text_add(location=(x,y,z))
and just want to set the text and cannot figure that out. I found in the python console that I can
bpy.data.texts['Text.001'].write("my text")
but (also generally) am confused how to reference the last created object to perform something on it. In tutorials there is the primitive_MESHTYPE_add
shortcuts which return not the object created. Can you tell me how to do Text.new()
?
bpy.ops.object.text_add()
ob=bpy.context.object
ob.data.body = "my text"