0
Posted July 14, 2014 in Rigging
Unity Camera
Profile Photo
By:daba
Insane Level
Gallery (171)
Downloads: 5
Price:FREE
   
Download Directly with Maya's AssetMan Plugin
File Size: 0.02 MB| Maya Version: 2014 x64 | Please Purchase Credits or log-in

Viewport



Source it manually or put it with your other mel scripts, and type “makeUnityCamera()” in a Mel script editor to create a Unity compliant camera. The camera’s transform will have a “width”,”height” and “angleOfView” attribute which you should set to what you have in Unity. Once you’re values match, what you see in Maya via this camera should be identical to Unity.

found here:

http://forum.unity3d.com/threads/maya-and-unity-camera-how-to.48259/

you can use script as well :
——————————————————-
global proc makeUnityCamera()
{

// Make a nice camera (16×9 by default)
// ————————————
string $cam[] = `camera -n “UNITY_CAMERA” -hfv 16 -vfv 9 -dfg on -dgm on -fl 35 -ff Overscan -ovr 1.1`;
rename $cam[1] ($cam[0]+”Shape”);

// Add an Angle of View, width and height to the camere transform
// ————————————————————–
addAttr -ln “angleOfView” -at double -min 0.0001 -max 180 -dv 30 $cam[0];
setAttr -e -keyable true ($cam[0]+”.angleOfView”);

addAttr -ln “width” -at double -min 0.0001 -dv 16 $cam[0];
setAttr -e -keyable true ($cam[0]+”.width”);
connectAttr ($cam[0]+”.width”) ($cam[0]+”.horizontalFilmAperture”);

addAttr -ln “height” -at double -min 0.0001 -dv 9 $cam[0];
setAttr -e -keyable true ($cam[0]+”.height”);
connectAttr ($cam[0]+”.height”) ($cam[0]+”.verticalFilmAperture”);

// Make an expression to handle UNITY to MAYA aov
// ———————————————-
string $exp = (“float $x = “+$cam[0]+”.width;\n”+
“float $y = “+$cam[0]+”.height;\n”+
“float $aov = “+$cam[0]+”.angleOfView;\n”+
“\n”+
“float $a = ($y/2)/tand($aov/2);\n”+
” $a = (($x/2)/(($x/2)/$a))*25.4;\n”+
“\n”+
$cam[0]+”.focalLength = $a ;\n\n”);

expression -n ($cam[0]+”_AOV”) -s $exp -o “” -ae 0 -uc all ;

}