Saturday, February 17, 2007

negative frames in shake

I once again post this for future web searchers who cannot find the answer they seek.

The problem I faced today grew out of the fact that some of our Maya scenes dip into negative frame numbers. RenderMan handles these reasonably well, outputting images with the following style of frame numbering:
frame.-0001.tif
frame.0000.tif
frame.0001.tif
shake, as far as I can tell, seems to expect the negative sign to fit within the padded width. In other words, it's looking for:
frame.-001.tif
frame.0000.tif
frame.0001.tif
After trying a few clumsy solutions, I ended up using conditionals in shake to manage this. Here's what my SFileIn nodes used to look like:
surfLayer=SFileIn("u1_12.surfcolor.#.tif");
(The # in shake implies 4-padding)

Now they look like this:
surfLayer=SFileIn( time < 0 ? "u1_12.surfcolor.@@@@@.tif" : "u1_12.surfcolor.#.tif");
This seems to import prman-made tiffs just fine. For some reason, I used a different format on the output line. I can't recall if I had to or if I was just experimenting, but either way, this works:
outp=FileOut(a,time < 0 ? "u1_12_comp.%05d.tif" : "u1_12_comp.#.tif","Tiff","rgb");
Hope this is helpful to someone, somewhere, sometime!

No comments: