A text object's text is supposed to show information like a subtitle. How could the text be changed on a frame # based trigger?


An application handler could be used to read subtitle data and display it by editing the text object.

import bpy
from bpy.app.handlers import persistent

def frame_change(arg):
    print("Load Handler:", bpy.data.filepath)
    t = bpy.data.objects["Text"]
    label = ("Frame # %d" % bpy.context.scene.frame_current)
    t.data.body = label

| improve this answer | |
  • 2
    $\begingroup$ There's no need for the @persistent decorator, unless you want the app handler callback to survive .blend file loading (also new file). API Docs $\endgroup$ – CodeManX Feb 11 '14 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.