keyframing text, how?

Here’s the hello world of changing a text object with python:

Open a new blend
Add a text object
Rename the object From “Text” to “TextObject” (optional really)
Make one of you windows a text editor (widen the text editor a little bit)
Click the new button
Copy these 2 lines of code and paste them into the text editor


import bpy
bpy.data.objects["TextObject"].data.body = 'foo123'

Click the ‘runs script’ button. Or hit alt-p

The text changes…

The script I use is only slightly more complicated, the script gets the x position of an empty, and changes the string to the integer value.