- Wed Aug 03, 2011 1:59 am
#345773
Hello guys,
I got a simple Mel Script that that i want to modify to link the Manual focus of the Maxwell camera to a included locator(included in the below script).
Please have a look...can someone update that for me? could be useful for those using animation with DOF directly in rendering.
I got a bunch of mel, expressions and GUI to write for production, is anyone interested for some jobs?
Thanks in advance
Roshan
VOXELPICTURES
--
global proc DOFcam ()
{
//curve -d 1 -p -1 -1 0
// -p -1 1 0
// -p 1 1 0
// -p 1 -1 0
// -p -1 -1 0
// -p 1 1 0
string $theCam[] = ` camera -dof 1` ;
float $fd = ` camera -query -fd $theCam[1] `;
string $theLoc[] = `spaceLocator` ;
move -a 0 0 (0-$fd);
select -tgl $theCam[0];
aimConstraint -aimVector 0 0 -1;
string $theGroup = ` group -em -name "DOFcam" `;
parent $theCam[0] $theGroup;
parent $theLoc[0] $theGroup;
string $exp = ( "float $diff[3] ;\n"+
"float $camPos[] = ` xform -q -t " + $theCam[0] + " ` ; \n"+
"float $locPos[] = ` xform -q -t " + $theLoc[0] + " `; \n " +
"\n"+
"for ($i=0; $i<3 ; $i++) \n"+
"{ \n"+
" $diff[$i] = $locPos[$i] - $camPos[$i] ; \n"+
"} \n\n"+
"float $dist = hypot($diff[0],$diff[1]); \n"+
"$dist = hypot($dist,$diff[2]); \n\n"+
$theCam[1]+".focusDistance = $dist ;") ;
expression -string $exp -name "DOFcamExp";
}
--
I got a simple Mel Script that that i want to modify to link the Manual focus of the Maxwell camera to a included locator(included in the below script).
Please have a look...can someone update that for me? could be useful for those using animation with DOF directly in rendering.
I got a bunch of mel, expressions and GUI to write for production, is anyone interested for some jobs?
Thanks in advance
Roshan
VOXELPICTURES
--
global proc DOFcam ()
{
//curve -d 1 -p -1 -1 0
// -p -1 1 0
// -p 1 1 0
// -p 1 -1 0
// -p -1 -1 0
// -p 1 1 0
string $theCam[] = ` camera -dof 1` ;
float $fd = ` camera -query -fd $theCam[1] `;
string $theLoc[] = `spaceLocator` ;
move -a 0 0 (0-$fd);
select -tgl $theCam[0];
aimConstraint -aimVector 0 0 -1;
string $theGroup = ` group -em -name "DOFcam" `;
parent $theCam[0] $theGroup;
parent $theLoc[0] $theGroup;
string $exp = ( "float $diff[3] ;\n"+
"float $camPos[] = ` xform -q -t " + $theCam[0] + " ` ; \n"+
"float $locPos[] = ` xform -q -t " + $theLoc[0] + " `; \n " +
"\n"+
"for ($i=0; $i<3 ; $i++) \n"+
"{ \n"+
" $diff[$i] = $locPos[$i] - $camPos[$i] ; \n"+
"} \n\n"+
"float $dist = hypot($diff[0],$diff[1]); \n"+
"$dist = hypot($dist,$diff[2]); \n\n"+
$theCam[1]+".focusDistance = $dist ;") ;
expression -string $exp -name "DOFcamExp";
}
--