Frame Counter Troubleshoot

posted to: Vanilla Ball Bounce

I'm following everything in this tutorial lesson and I get the ball bouncing nicely. However, I'm noticing that the "frame counter" is stuck at "01" in the camera display/render. How can I fix that?

  • Jacob Phillips(skipper9000) replied

    Okay, I figured it out. I had to add some Python code to the existing animation_multiball277.py script written by Wayne Dixon for the MultiBall Rig and I had to delete the Animation component attached to the Text object. Here's how:

    1. Expand the Text object's components and delete the Animation component
    2. Select the Text Editor view in one of your view-ports and give yourself some room
    3. Make sure the animation_multiball277.py script is selected as the text to be edited
    4. After the rig_id = "Multiball_rig" assignment on line 13, add two more variable assignments:
      1. scene = bpy.context.scene
      2. obj = scene.objects['Text']
    5. After the is_selected(conext, names) function definition on lines 62 to 73, add the following function definition:
      1. def recalculate_text(scene):
      2.       obj.data.body = str(scene.frame_current).zfill(2)
    6. At the end of the file, after the if __name__ == '__main__': register() conditional statement, make this call to an existing handler with the function you just defined:
      1. bpy.app.handlers.frame_change_pre.append(recalculate_text)
    7. Hit the Run Script button on the Text Editor view-port and you should be good-to-go
      1. Test this out by clicking through some frames in the Timeline view-port, you should be seeing the Text changing to the Frame count now.


  • promometer replied

    Thanks a lot, Jacob! Great job! 

  • Wayne Dixon replied

    Or you can download the "Blender Text Counter" Add-on and it will make it work.

    https://github.com/leomoon-studios/blender-text-counter