2
$\begingroup$

I was modelling a sci-fi style digital clock, and when finished, I realized that I had no idea how to make the animation.

I made the numbers, but I cannot figure out a simple way to make it work.

I thought I could make all the ten numbers and then hide and unhide them every second, but takes too long.

Does someone have any idea? can someone suggest me a easier way to do it? Thank you

$\endgroup$
1
  • $\begingroup$ You could try making all the numbers 0-9 in a frame range that won't be rendered. Then just copy them over from the dopesheet when you need them. $\endgroup$
    – Eric Xue
    Commented Jul 30, 2020 at 18:47

1 Answer 1

3
$\begingroup$

Some python code can do that for you:D

  1. Create two text objects and name them 'hour' and 'minute' respectively
  2. Run scripts below.
  3. Scraping the Timeline and you now have a digit clock animation. (Choose a digital font if you like.)

scripts:

import bpy


def update(self):
    frame = bpy.context.scene.frame_current

    minute = bpy.data.objects['minute']
    hour = bpy.data.objects['hour']

    hour.data.body = str(int(frame/60) % 24) + ' :'
    minute.data.body = str(frame % 60)


def register():
    bpy.app.handlers.frame_change_post.append(update)


def unregister():
    bpy.app.handlers.frame_change_post.remove(update)


register()

enter image description here

$\endgroup$
6
  • $\begingroup$ Oh what a nice answer :). I'm definitely going to use this in the near future :). $\endgroup$ Commented Jul 30, 2020 at 21:35
  • 1
    $\begingroup$ Glad you like it:) $\endgroup$
    – bao007fei
    Commented Jul 31, 2020 at 7:27
  • $\begingroup$ thank you very much for giving me an answer that soon! i really wasn't expecting that. however, probabliy because i'm a beginner and i'm not good at scripting, the script that you sent me doesn't work. i tried to replicate your screenshot: drive.google.com/file/d/1BGXZ3TbQrBL1gkX8DmXtjNPu8Sw_AvR3/… can you help me one more time? i wuold really appreciate that $\endgroup$
    – federico
    Commented Jul 31, 2020 at 21:49
  • $\begingroup$ @federico Access the driver need a permission. I've sent the request. $\endgroup$
    – bao007fei
    Commented Aug 1, 2020 at 4:13
  • $\begingroup$ @federico It looks like you don't run the scripts. Button is in the topbar of text editor. Run scripts first. Then scraping the Timeline. $\endgroup$
    – bao007fei
    Commented Aug 2, 2020 at 6:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .