Tuesday, February 20, 2007

A night out, fascinating conversation

Okay, here are a few things I talked about with some friends tonight and thought I'd share more broadly.
And here are things I heard about but haven't checked out yet:

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!

Wednesday, February 14, 2007

"Catch" in Tiburon

"Catch" has a time and day now at the Tiburon International Film Festival. 11:10am, Sunday March 25. It's part of an animated shorts program.

I'm worried that the time and day of this program will attract parents with their little kids. From the thumbnails of some of the films, I don't think they're all going to be kid-friendly. I think a lot of festivals do this still with animated shorts: assume they're all for young people and schedule them that way. Well, I haven't seen all the films so I can't say for sure, but the guy with a gun to the back of his head sure doesn't feel preschool to me.

Thursday, November 9, 2006

simple dynamics in MEL

I've often wondered how to build an expression in Maya/MEL that would implement some simple dynamics. For instance, if I want an attribute to be dependent on an object's velocity, how can I get the velocity?

I learned yesterday that you can use the "keyframe" command within an expression to query for the value of an animation curve at a different time.
This isn't an ultimate answer, but it provides a good tool to getting closer.

So here's some code for determining the frame rate of change of an attribute. In this case, pSphere1's tx attribute.

// get the previous frame
$newt = frame - 1;

// query pSphere1's tx anim curve from that frame
$oldx = `keyframe -at tx -t $newt -q -eval pSphere1`;

// this is ugly, but it turns the array result into a float.
// someone please show me how to do this "properly"!
float $ox = $oldx[0];

// now compute the difference
$delta = $ox - pSphere1.translateX;

(and now for search indexing, since these are the keywords I was searching for to find this answer: velocity mel expression dynamics)

Saturday, August 26, 2006

ratOcclusion, or, the SL code I most wish to see

Over the past few months I've run into a number of bugs with the Pixar-supplied mtor/RAT occlusion shader "ratOcclusion". First of all, it has these crazy artifacts at small scales, and second, it gives me yet-to-be-understood white grid patches when the shading rate is too low, or the image is too big, or... well, that's the problem. I have no idea what these artifacts come from, I just know I hate them, and that I spent hours re-creasing the mtor subdivs in the film (yes, this is still about The Incident at Tower 37 project) when, in fact, the creases weren't the problem at all.

Anyway, I just put together my own occlusion shader that seems to fix these bugs. The hope is that it can be the show-wide occlusion shader, so I need to make sure it is fast. How my straightforward shader is different from what ratOcclusion is (under the hood) is a mystery.