By voxelpictures
#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";


}

--
User avatar
By inefecto
#353405
I use a "distanceBetween" node to have the distance between the focus_locator and the camera.
Use the connection editor to link the wordMatrix of the cameraShape to the inMatrix1 and worldMatrix of the locator to the inMatrix2 param of the distanceBetween node.

In second time use this mel line to link the distanceBetween and the manual focus distance (Be sure that Maxwell manual focus is enable before) :
connectAttr -f distanceBetween1.distance cameraShape.mxFocusDistance;

In fact I have done this once and I save ma camera rig in separate file to import each time I want.
hardware question :)

I can easily create an usable render in 15/20 mi[…]

Maxwell for Rhino on Max missing Toolbar

Hello, For some reason, the Mac version of Rhino[…]

Let's talk about Maxwell 5.2

Price for sure matter a loot. Speed is the core i[…]

Materials translucent with V5.1

Well, the problems can be in the chair, the monito[…]