View Full Version : how to offset timecode through text node?
JustinAlvarez 02-15-2006, 04:36 AM Hey guys,
Can someone explain to me how I can offset my timecode through a text node using expressions? I am using %T but of course it only starts at 00.00.00.01. or better still, how can I burn in the embedded header timecode through a text node? {filein.TimeCode} or something like that??
Thanks,
Justin
| |
wpiggy
02-15-2006, 03:12 PM
First of all. If you're deal with scanned film plates, LabRoll timecode embedded in file name. For example:
file name scan.678240.dpx corresponds frame with timecode 07:32:09:15
That's quite simple - 00:00:00:01 corresponds frame 1, 00:00:01:10 frame 35 (in 25fps based timecode, of couse, coz i'm living in Russia :)) and so on.
The clearest and simpliest way to burn this code in Shake is to import sequence, placing it using "sequence start" mode, not "frame 1". In this case number of file in sequence corresponds Shake timeline and via %T you receive correct timecode.
Another way not so simple, a little bit of coding :)
You must use (time+your sequence start frame-1) and then "parce" resulting textstring, to extract "hours mins secs frames", corresponding to your timecode base.
Thats listing of perl script, which parse frame number and return time code with 25f base. It's quite clear and you can use same algoritm in Shake text node. If i'll have spare time i'll translate this script to Shake.
-------
# Frame to 25fps TC convertor
# (c)wpiggy
in:
print "Enter Frame number \n";
$fr = readline(*STDIN);
if ($fr =~ /(\d)/)
{
#Hours
$h = int(($fr/25)/3600);
if ($h < 10)
{
$tc = "0$h"
}
else
{
$tc = "$h"
}
#Minutes
$m = int((($fr/25)%3600)/60);
if ($m < 10)
{
$tc = "$tc:0$m";
}
else
{
$tc = "$tc:$m"
}
#Seconds
$s = int(($fr/25)%60);
if ($s < 10)
{
$tc = "$tc:0$s"
}
else
{
$tc = "$tc:$s"
}
# Frames
$f = ($fr%25);
if ($f < 10)
{
$tc = "$tc:0$f";
}
else
{
$tc = "$tc:$f"
}
print "Frame $fr -> TC $tc\n";
goto in;
}
else
{
print "Wrong input. Print frame number \n";
goto in;
}
JustinAlvarez
02-16-2006, 07:51 AM
thanks wpiggy.. but what is the syntax to parce the resulting textstring in shake so i end up with timecode?
wpiggy
02-18-2006, 08:10 PM
Syntax of Shake expressions described in manual. Also you can use C syntax to parce string.
Feel free to drop me a line to wpiggy _at_ melnitsa.com
CGTalk Moderation
02-18-2006, 08:10 PM
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-2009, Jelsoft Enterprises Ltd.