View Full Version : shake scripting question

04 April 2006, 03:33 AM
I am trying to make a macro that will display embedded dpx timecode since I haven't had success with the one I found on

What it does is take the filename (the frame number is embedded in the filename after scanning) and then does the math to arrive at timecode and then print this through a text node.

The problem is, that the filename is a string.. so i need to convert this to an int to be able to do the math, then convert back to a string, since the text node can only accept a string. I have used "atoi" to convert the string to int, but as far as i have found, I can't convert this back to a string once i have arrived at the timecode I want to print (sprintf is not recognised by shake?).

Anyone know how this can be done?

Thanks for any help

04 April 2006, 01:30 AM
i know that there is a itoa funtion to convert int's to strings BUT i think its either only on windows or linux I cant remember, I know for a fact its not on a mac because I tried it....mmm

sprintf() wont work BUT using printf("Frame Number = %i (or %s for a string) \n", varible); in a local variable in your text node will work....mmm not sure if that helps

mmm thats all i got right now,

04 April 2006, 09:01 AM
The function you want is:

const char *stringf(const char *, ...);

04 April 2006, 03:48 AM
Thanks Hugh, that was exactly what I was looking for. Cheers.

CGTalk Moderation
04 April 2006, 03:48 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.