Page 1 of 2

DOF Helper Tool for Maya

Posted: Thu Mar 17, 2005 5:38 pm
by abgrafx3d
Based on the "DOF toy for Max" that dschaga created and the idea that 8etty had (connecting the near focus limit and the far focus limit to the near clipping plane and the far clipping plane), I decided to see if I could make this work.

Here's what I did manually:

1. Create a new camera - name it "DOFhelper"
2. Parent constrain the new camera to the Maxwell camera with no offset
(maintain offset unchecked - camera should snap to Maxwell camera location)
3. Show clipping planes for "DOFhelper" cam
4. Create the following expressions for the "DOFhelper" cam for NearClipPlane and FarClipPlane respectively:

DOFhelperCameraShape.nearClipPlane=100*MXCamera1.nearFocusLimit;
DOFhelperCameraShape.farClipPlane=100*MXCamera1.farFocusLimit;

(note: the factor of 100 is because the units of the near and far focus limits in the channel box for the Maxwell camera are in meters - just converting to cm)

5. To show or hide near/far focus limits (clipping planes of "DOFhelper"), select the "DOFhelper" cam and go to Display, Camera/Light Manipulator, Clipping planes from the menu

I'll automate this in a mel script soon :D

Posted: Thu Mar 17, 2005 5:50 pm
by ludenhud
That sounds pretty sweet, but I think I wait for the mel :D or why not post a .mb scene file with the camera loaded until the mel is done? :]

*PM me if you want web-space for 5-6mb

Posted: Thu Mar 17, 2005 6:14 pm
by DELETED
DELETED

Posted: Thu Mar 17, 2005 7:10 pm
by tom
:D happy coding wayne! this is cool news for maya users ...

Posted: Thu Mar 17, 2005 7:56 pm
by Maya69
very good stuff

i try

thank

Posted: Thu Mar 17, 2005 10:03 pm
by pabl0
cool !

thanx abgrafx !!! :wink:

Posted: Thu Mar 17, 2005 10:06 pm
by Takumi Takahashi
Good idea, abgrafx !
If you need some help with MEL, let me know.

Posted: Thu Mar 17, 2005 11:36 pm
by jep
I can't wait to try this! Great post!

Posted: Fri Mar 18, 2005 12:54 am
by abgrafx3d
ludenhud wrote:why not post a .mb scene file with the camera loaded until the mel is done?
Here's the DOF test scene with the "DOFhelper":

http://abgrafx.com/maxwell/testDOF1_revised_clip.mb

also one other thing, needed to add one more expression for the focal length of the "DOFhelper" cam:

DOFhelperShape.focalLength=Maxwell_CameraShape.focalLength;

Change to the perspective cam, select the "DOFhelper" cam from the outliner and then show clipping planes (Display, Camera/Light Manipulator, Clipping Planes from menu) and you can see the range of focus (total depth of field) visually. :wink:

I'm getting close with the mel script for this :D

Posted: Fri Mar 18, 2005 2:07 am
by abgrafx3d
Takumi Takahashi wrote:If you need some help with MEL, let me know.
Here's the script:

DOFhelper V1.1

I have not thoroughly tested this yet, so use at your own risk.

Does anyone know how to display clipping planes in mel? The only thing I found was:

ShowCameraManipulators;

but this shows center of interest, pivot, clipping planes and cycling index - I only want to show clipping planes.

Thanks everyone for the comments/praise - just trying to help make things easier :D

Posted: Fri Mar 18, 2005 2:54 am
by iker
abgrafx3d, you are a great man! :D

Thanks for your help!

Posted: Fri Mar 18, 2005 3:59 am
by abgrafx3d
Thanks iker! Glad to help!

Posted: Fri Mar 18, 2005 5:12 am
by jep
abgrafx3d - YOU ROCK!

Thanks!
Jep

Posted: Fri Mar 18, 2005 7:25 am
by Takumi Takahashi
abgrafx3d wrote:
Takumi Takahashi wrote:If you need some help with MEL, let me know.
Does anyone know how to display clipping planes in mel? The only thing I found was:

ShowCameraManipulators;

but this shows center of interest, pivot, clipping planes and cycling index - I only want to show clipping planes.

Thanks & good stuff... btw below line should show the camera manip for DOFhelper.

renderManip -cam off off off on off DOFhelperShape;

I guess you can insert this somewhere after you created your DOFhelper camera (haven't look at your script yet).

Also it would be useful to show both camera in the 2 pane layout.
such as ...

TwoStackedViewArrangement;

This way you may not need to show the clipping planes.

-tak

Posted: Fri Mar 18, 2005 10:49 am
by tom
i'm not in maya but your work is cool Wayne...keep it, thank you again!