View Full Version : clock
Hi,
I need a running clock. I want to make it with the spline shader. I managed to get the hours, minutes and seconds as separate numbers with Xpresso. But could anybody help me out how to get the numbers in a xx:xx:xx notation? So that I can use this string as an input for the Text field of the Spline shader?
Another problem is how to get the leading zero.
I guess I need Coffee for this, but I've no programming experience.
I tried the coffee node, I do understand how the default string works. But instead of adding the input fields I would need to know how to create a string. Like the simple Hello world thing.
I hope my question is not to difficult or demanding.
And oh yes, I mean that I want to let the clock show the document time. So it needs to be based on the time node.
|
|
Scott Ayers
04-21-2010, 10:13 PM
Here's a screen capture on how to make the system clock change xpresso text splines.
Please be very careful with this. Because I'm not sure if doing this is a good idea.
Xpresso normally only calculates the nodes every time the time line scrubber changes.
By using Event Add() in the coffee node. I'm brute forcing it to constantly update even when the time line is stopped. So It's possible that this could lead to memory drainage and eventually a crash if this is left running for an extended period of time. So you might want to double check this with Maxon's tech support about this just to be safe.
Without knowing how xpresso handles memory. This kind of thing scares me a bit.
-ScottA
mazab
04-22-2010, 10:14 AM
Here's a file that uses XPresso to display the current time of the timeline in mm:ss:ff (minute second frame). It's 100% memory leak clean :)
I hope you don't mind if I use this file for one of my next Shots of XPresso cause it's a really nice example of how to work with text strings with XPresso only, no COFFEE used.
Here's a file that uses XPresso to display the current time of the timeline in mm:ss:ff (minute second frame). It's 100% memory leak clean :)
I hope you don't mind if I use this file for one of my next Shots of XPresso cause it's a really nice example of how to work with text strings with XPresso only, no COFFEE used.
Yeah, many years ago I did it as well - from frames and inicial constant value. I have there a standard clocs as well (non digital). If you want I can try to find it....
P
http://img1.grafika.cz/grafika/images3/cinema4d_xpresso_hod_19.jpg
ufff 10.6.2004 - 6 years with Xpresso :-)
mazab
04-22-2010, 10:28 AM
Putting a RangeMapper at the outputs of minute/second/frame before the "Add leading zero" group you can adjust my setup to work as an analog clock as well. Just use the RangeMapper to map 60 seconds (plus one for 60 minutes, and one for FPS frames) to 360 degree and put that in the rotation of the clock hand.
mazab
04-22-2010, 10:39 AM
Update: Digital plus analog clock
Thanks for the ideas. I'll have a look at them later on. I'm on a thight scedule right now. I managed to fix the clock with the EnhanceC4D shader. Luckily the font it uses was accepted by my client. I saw the clock pzdm created. But this is adressing objects instead of a spline shader. And it was missing leading zeros.
mazab
04-22-2010, 01:33 PM
Simply wire the output of the digital clock to your SplineShader input instead of the SplineObject input.
Wow, thanks a lot mazab. I didn't know you could use the add operator as a string operator.
CGTalk Moderation
04-23-2010, 06:22 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.