shake scripting question

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  04 April 2006
shake scripting question

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
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
The function you want is:

const char *stringf(const char *, ...);
Hugh Macdonald
  04 April 2006

Thanks Hugh, that was exactly what I was looking for. Cheers.
  04 April 2006
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 10:50 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.