Using the very basic concept of the frame_change event, it is possible to
update the body of a text object and render it as an animation.
Search the blender API docs for more information on frame_change_pre
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from random import choice | |
from string import ascii_lowercase as lowercase | |
if not 'Text' in bpy.data.objects: | |
bpy.ops.object.text_add() | |
def make_char_list(): | |
text = "This is the Text and some hullabaloo" | |
char_list = [] | |
for idx in range(len(text)): | |
random_text = "" | |
for token in range(idx): | |
if text[token].isspace(): | |
token = text[token] | |
else: | |
token = choice(lowercase) | |
random_text += token | |
char_list.append(random_text) | |
char_list.append(text) | |
return char_list | |
char_list = make_char_list() | |
def my_handler(scene): | |
frame = scene.frame_current | |
if frame > len(char_list): | |
current_string = char_list[-1] | |
current_string = char_list[frame] | |
bpy.data.objects['Text'].data.body = current_string | |
bpy.app.handlers.frame_change_pre.append(my_handler) |
Search the blender API docs for more information on frame_change_pre