Animating "Text" Object's text value

Hi everyone can you guys or girls help me with my problem?. i want to animate the text value of the “Text” or “Font” object in blender, i don’t know if that’s possible but i know you can access that value via python. so here’s my problem i want to animate the text value if possible link it to the “Custom Properties” of that object, so here’s what i want to achieve with it i want to animate a (1)digital clock display or a (2)digital speedometer for a bike that i’m working on. I could use or animate a texture but i want it to be flexible, and oh BTW if possible I want this in real-time, you know, as i change the “custom properties” the text value also change. if only blender have this function :(. anyways if anyone can help me with this i would really really really appreciate it … thanks in advance :slight_smile:

I made something about that : “Dynamic Text” addon.

Link : https://dl.dropboxusercontent.com/u/44748446/Blender/dynamicTextPanel.py
Forum : http://blenderclan.tuxfamily.org/html/modules/newbb/viewtopic.php?topic_id=41384&forum=2 (Only in French sorry)

The control :

  • “Add to Timeline” : Add your text and it’s frame start to the “timeline”. A “bloc” will be created and can be edited.

  • “Add custom” : Add a custom value which can be used into your “blocs”. This value can be a float or a timer one. The main interest of this is to animate the value. When created, the custom value get a name like “%2” which can be integrated into your text : all you need to do is inserting the name. Example : “I have %2 bottles of beer on the wall”

  • “Set” : Modify the current bloc to the one actually showed in the 3D View. Useful for word wrap.

  • “import srt file” : DON’T USE IT ! It was made to import subtitle file but it is now completely buggy (and occasionally useless)

  • “Bake blocs” : Convert the texts dynamically changeable (using python) into multiple text objects with visibility keyframed. Useful when you append yours texts into an other project. WARNING : Incompatible with custom values.

A short example for a simple clock:


import bpy

def get(self):
    if 'text_animation_timer' in self:
        return self['text_animation_timer']
    else:
        return 0
    
def set(self, value):
    self['text_animation_timer'] = value
    hours = value // 3600
    minutes = (value % 3600) // 60
    seconds = value % 60 
    self.body = "%.2d : %.2d : %.2d" % (hours, minutes, seconds)

bpy.types.TextCurve.text_animation_timer = \
    bpy.props.IntProperty(
        name="Elapsed Seconds",
        get=get,
        set=set,
        min=0
    )

Just add a custom property named “text_animation_timer” to the TextCurve in the Properties Area -> Text Tab and animate it (Right Click ->insert keyframe or driver)

thanks guys thank for your replies, you we’re really helpful. i’m gonna try it out now thanks again :slight_smile: