Showing posts with label Camera. Show all posts
Showing posts with label Camera. Show all posts

Thursday, July 26, 2012

FBX Export for Camera Matching in 3dsmax

Here is another tool i developed for RTT some time ago. It's a hybrid script utilizing MEL and MAXScript that automates the process of camera matching (still images) by integrating 3dsmax's Camera Match into an existing Maya pipeline. It was meant to speed up the whole process, establish a unified workflow and relieve the artists of all the tedious task (like browsing for files, adjusting settings, etc.) that ate up time or could've been error sources in the past.



Automated tasks:
  • export selected geometry as FBX (bypassing the FBX export dialog)
  • run 3dsmax (works with 2009-2012, automatically runs latest version you have installed)
  • import FBX geometry into 3dsmax (bypassing the FBX import dialog)
  • set render settings in 3dsmax (according to size of given image file)
  • set backplate in 3dsmax (matching render output)
  • configure Nitrous viewport (3dsmax2012 only)
  • configure units and snap settings (3D snap to vertex)
  • maximize perspective viewport and frame imported geometry
  • save 3dsmax scene file
  • switch to CamPoint tool so you can start working right away
  • one-button interface in 3dsmax for FBX camera export (bypassing the FBX import dialog)
  • import camera into Maya & create image plane with the given image
 
 (click to enlarge)
 
The tool is being used on a regular basis and has proven to be a real time saver in production.

Monday, June 4, 2012

Custom Image Plane and Correct Aspect Ratio

When i read this post on cgTalk i remembered a tool i wrote some time ago for a friend that needed a custom mesh based image plane. So i dug out the script and made a little tool from it. 


The setup is fully node based (no expressions, fully interactive) and calculates the corners of the image plane from camera aperture and focal length. Locators are placed at these calculated positions. The scaling of the image plane is then calculated from the distance between these locators.
There's an attribute on the camera shape called "Image Plane Distance" which lets you - as the name implies - adjust the plane's distance from the camera. Another attribute ("Use Film Offset") lets you define whether the image plane should be offset with the cameras film offset. A shader with connected file texture is also automatically created (and assigned) to the image plane as well as a display layer.

For the system to work, the camera's Film Aspect Ratio (the aspect ratio of the aperture) must match the Device Aspect Ratio (the with/height ratio of the rendered image). When creating a custom image plane, the tool will automatically adjust the cameras aperture for matching aspect ratios. To ensure that your framing is maintained, the aperture can only be adjusted in certain ways depending on your setting for the Film Resolution Gate (Film Fit). 

Here are the rules for adjusting the aperture and maintaining the framing:

// FILL
// adjustment depends on difference between device aspect ratio and film aspect ratio
   // if film aspect ratio > device aspect ratio --> adjust horizontal aperture
   // if film aspect ratio < device aspect ratio --> adjust vertical aperture
 
// HORIZONTAL
  // adjust vertical aperture
 
// VERTICAL
  // adjust horizontal aperture

// OVERSCAN
// adjustment depends on difference between device aspect ratio and film aspect ratio
   // if film aspect ratio > device aspect ratio --> adjust vertical aperture
   // if film aspect ratio < device aspect ratio --> adjust horizontal aperture

You can also use the script to only adjust the cameras film aspect ratio (without creating the image plane). It's advisable to do this before exporting your camera (e.g. to Nuke or Fusion) to ensure the camera will match the footage.

You can download the tool HERE.

Known issues:
This system only works for square pixels because it does not take the Pixel Aspect Ratio into account. It would be possible to integrate, but i never render anything but square pixels.