Search - User list
Full Version: Mantra Depth of Field
Root » Technical Discussion » Mantra Depth of Field
Andre
I want to animate a camera that is looking at an object, but I want to keep it in focus without having to animate the camera focus parameter manualy….
Is there any way to link the distance between the camera and that object to the FOCUS value of the camera?

Thanx a lot

Andre Souza
JColdrick
Have you tried the “distance” expression? Page 6 in the expressions pdf - I haven't tested this below, but something like:

distance(cam/tx,cam/ty,cam/tz,foo/tx,foo/ty,foo/tz)

put into the “Focus” field of the cam. “foo” is the object in question.
Note this is pseudo-code - I avoided the complete thing since it would be so long.
for instance, the “cam/tx” portion would actually be:

ch(“/obj/cam/tx”)

Cheers,

J.C.
Andre
it worked perfectly….

thanx a lot for tip!

Andre C. Souza
stevenong
Hi Andre,

You can use the Object CHOP to calculate the distance between the Camera & the target Object.

After calculating the distance, you can Export the data to the Focus parameter of the Camera. To do that, Right Click & Hold on the Object CHOP & select “Exporter - Set Scope…” which will bring up a dialog window.

Please make sure the Camera's Parameters is visible, especially the Focus parameter. Next, click-and-drag the “dist” parameter in the “CHOP Exporter” dialog window to the Focus parameter. You will get a “Turn Right” mouse cursor as you're dragging & a “+” sign will appear when the cursor is within the Focus parameter.

Release the mouse button & select “Export CHOP” from the pop-up. You'll notice the Focus parameter is now Orange which means it's getting the data from the Object CHOP.

Look Mom, no keyframing!

I hope the above helps!

Cheers!
steven
Andre
Right on Steve!

it worked also…

thanx a lot for the help!

Andre C. Souza
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB