Saturday, January 31, 2009

Wrapping a 3D object in post

Another long technical post. Studio work brings it out in me. This one is for Rich.

Been working for the last few weeks on a big broadcast thing (can't say what). But came across a situation in Maya that I've come across a few time before and never had a good solution for. It's probably that I'm just dense and there is an easy solution, and I've certainly never researched it extensively, but it's kind of annoying. Here's the situation:

I have a circular object (or a sphere, or a spiral or whatever) and I need it flowing or spinning around an object. Normally, not a problem, I'd just put the center object (or a card with video of the object) in the 3D scene and render it that way. Just did that recently on shot with faces inside 3D bubbles. But often, as is the case here, the video that needs to go inside (or sandwiched between) the 3D object(s), needs to be put there by someone else after the 3D render, in the edit.

In this case we've got clips of talent and video that hasn't even been shot yet, let alone color corrected or finalized in any way. So I need to somehow make a tool kit that allows for things to go IN FRONT OF AND BEHIND ONE OBJECT AT THE SAME TIME in an easy way that an Avid editor can do without much instruction from me.

Example. How do I comp this assuming things are moving around and flowing, etc.

The most obvious way is to just mask things by hand (ie. lay the 3D on top and mask out the back sections). But in these shots I'm working on, there are LOTS of pieces and they're all spinning and moving,etc. Don't want to ask someone else to do it and I definitely don't want to get stuck with it. The other solution is to just reframe stuff or change the shots. That would make me feel JV, and wasn't really an option here.
So I thought about for a few minutes and came up with two solutions, both kind of similar, but slightly different in terms of workflow:
1) create a depth shader for the 3D objects that is binary. That is, beyond a certain distance it's black and in front of that distance it's white. Then I'd render the scene normally and use the output of the shader to mask either the front or the back.
2) use the camera clipping planes to chop the render in half and render two separate passes, one for the front half and one for the back half.

I ended up choosing route #2 because it seemed to be the easier thing to pass off to the guys in post. I also KNOW what will come out, basically. The renders on this project are relatively simple, etc, so I think it'll work just fine. I think there are advantages to both methods, and I suspect now that the depth based solution would be the more robust one in many cases, but granting that, here's how I created a workable solution:

As I said, the objects and cameras are moving around, so I needed something a bit more flexible than just typing in numbers. I wrote a script that creates a distance tool between an object (can be whatever transform you want) and the camera. The script just uses some conditional nodes to pump in the distance to the object's pivot to the far and near clipping planes and switches them based on an attribute in a null group. So I can just select the circle (or a locator parented to the circle) and the camera and run the script. Then I set up render layers with the switch set to "near" and then "far" and render the two layers. I get the scene rendered with just the front and then just the back and I can just hand off those two renders.

In post you just sandwich some video in between these two renders. Easy to understand, I hope, for the editors.


Here's the script I wrote: zbw_splitPlane.mel
Some limitations of my method (which is why I'll probably redo it the masking method, at some point) are that you won't get reflections (I don't think) from objects in front of the split plane. Not really a problem in my shots, cuz there's almost no reflection and things are really zipping around.
The only thing I could see possibly going wrong the masking/depth method would be that things crossing (front/back) could create issues when you actually want to see something in back, but it is occluded by an object in front. There would be no way to get images of JUST the things in back.
Anyways, if anyone has any other thoughts or ideas or solutions for this type of thing, I'd love to hear them.
As always, re: scripts, my code is inelegant and usually just me hunting and pecking around for ideas that work. Don't judge me, just love me.

Saturday, January 10, 2009

Reel redux part deux II the second and so forth

Based on some generous comments from a few friends (see below), I've recut my reel. Trimmed about a minute out of it. (of course now I have to redo the breakdown, but that'll have to wait.)
I actually knew that it was running long and had some weaker stuff in it towards the end, it's just hard to trim things down when you're rushing between all the stuff you have to do (cue the weepy music). . . I tightened some edits at the front and cut a bunch of older 2D stuff at the end. It's probably still a bit wobbly towards the end, but at least it's shorter. It's in the same place.
At some point it will be worthwhile for me to spend a proper amount of time cutting and even designing a nice reel. And redoing my site a bit. And buying some new shoes. Which will come first?
I'm finding reels are a funny thing nowadays. I don't remember the last time I sent someone (or gave out) a DVD of my reel. It's all web-fied. So I don't really think about it too much. Lots of people I know (and respect) don't even really HAVE reels! They either just link to complete works or flash a winning smile or something to get work (realistically, it's probly mostly word of mouth). As a freelance generalist, tho, cutting a reel is actually getting a bit harder, showing a full skillset. I haven't put any interactive stuff (DVD menus, etc) on my reel in ages, though for a couple of years, that was the bulk of my income. . . Definitely don't want to cut multiple reels at this point . . . So I suppose the answer is to design a better website that will allow me to compartmentalize some of that. (kind of non-plussed by that notion, too, though). Ideas are welcome . . .

I also wanted to point out that I've added two new links:
Keith Kin Yan is terrific photographer and designer (and 3d guy and so forth) out in LA. He collects sneakers and ride bicycles, too.
Mike Gallay is a talented animator with a beard who also does ridonkulous Flash work. You can acquire and use some it (for a nominal fee . . . ) here.

OK, no more posts without some artsy or techy meat . . .

Wednesday, January 07, 2009

New reel . . .

I've re-cut my reel, finally. Good grief, that's no fun. I had a small break in the schedule, so I spent a couple of days throwing stuff together from the last year or so . . . Of course, as always, there are 3 or 4 things that I would love to put in there, but yet can't because of legal reasons (or they're not quite done). Say la vee.
I've also been backing up my drives so a bum drive doesn't kill ALL of my stuff. Now I'm up to 7 drives counting the one in my G4. It's becoming a bit of a tangle. Since I work at home a lot, I end up with mega files to backup. Seems to me that one BIG drive is easier, but puts you more at risk. So I have lots, which is super confusing. Any thoughts on a better way?
BTW, I'd also love to hear crits on the reel (it's a generalist reel for commercial/design work here in NYC). The link is here.
For some reason I'm getting a weird white box around the quicktime, but only Firefox. Not sure why. Any help there would be nice too. Mike?

Peace and Happy New Years! Hopefully I'll get post some more fun stuff soon, though I've got a job (I think) for the next few weeks, so we'll see. Just for goofs here some concept art via Richy for the next Ilksville:

click the pic for larger