Oct 14, 2010

Extending camera projected image in nuke - quick tip

Imagine this situation: you have a tracked scene, got the camera, using it (on 1 frame) for projecting a mattepaint to a proxy geometry. Then you go on compositing, huge node-tree builds on this  projection. And then suddenly you notice (or worse, the sup notices) that on a few frames the matte not covering enough area, needs to be extended. Everything else should remain as is, but you have to paint a good 50pixels more, outside the current mattepaint's format. The problem is: if you scale/translate the matte and paint the needed area, the current projection will crawl away. If you paint using the current format, but outside the image, making the bounding box larger, that will be cropped off by projection, as it is ignoring the bounding box.
The solution is simple: use a reformat before projection, using scale parameter, and link that value to the focal length of the projector camera, using the expression (assuming the original focal length of projection camera was say 25mm):
1/Reformat1.scale*25
Reformat1 is the name of the reformat node before the projection. So when changing the scale value of that node, the proj. camera will change it's fov accordingly. Scale to 1.2, and everything will stay as it was, but extended part will appear, or at least will be in the bounding box. Important: the reformat's resize type knob should be none!
This way the new painted area can be revealed easily. If the camera still cropping the image, try to adjust the overscan parameter in the scanline renderer, as this can crop the image too.
I'm going to make a few images later to illustrate this process.

12 comments:

  1. thanks dude..
    amazing tip:)
    works like a dream...

    ReplyDelete
  2. Thank you very much!! This trick is genius))

    ReplyDelete
  3. Many thanks man... struggled using various tech... You are handy.....

    ReplyDelete
  4. Gracias amigo. Estaba tratando de solucion esto, me imaginaba que habia una forma, pero no podia resolverlo, muchas gracias!

    Thanks! i was trying to resolve this from a long time, i know that exist a solucion but i couldn't find it by myself. thank you very much.

    ReplyDelete
  5. I can't get this to work! changing the scale is driving the focal length but it's scaling up the image too in doing so eliminates the black edges but outputting a bigger image .. any idea why?

    ReplyDelete
    Replies
    1. did you do the resize type = none in the reformat as the author suggested?

      Delete
  6. Hi, did you set the reformat resize type to "none"?

    ReplyDelete
  7. Hey i had this problem but instead of using a expression i just reformat up a scale with resize set to none, paint in the extra pixels then reformat back down preserving the BB box. Then on the projection node set the crop to off and render out. the projection will not update in the 3d view correctly but it renders right if you want to keep the pixels outside the BB box after the scanline then turn up the over scan

    ReplyDelete
  8. Brilliant! Just the fix. Works like a dream.

    ReplyDelete
  9. saved my day! thanks man! :)

    ReplyDelete