Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 07-01-2004 , 06:00 PM
Registered User
Join Date: Jan 2004
Posts: 17

Keyframe Depth of Field?

How does one Keyframe the Depth of Field attributes?

I have a little test sequence where I have three primitive shapes lined up. I set the camera to focus on the middle shape. I then animated the camera to move through and around the shapes. Much to my dismay, I could not keyframe the focus distance to stay focused on the center object.

How is this accomplished? Thanks.

# 2 07-01-2004 , 11:23 PM
Pony's Avatar
Subscriber
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
wandering to clear something up. you could not keyframe the Field attribute at all or you key framed it but its dificult to get the field to stick right whare you want ?

# 3 09-01-2004 , 05:05 AM
ragecgi's Avatar
Registered User
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Good points as usual Pony!

Also, just an fyi, to my knowledge, depth of field is not keyable in an "axial" sense.

However, you should be able to key it for distance from cam.


Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
# 4 09-01-2004 , 09:52 AM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
this would be much simpler in post. You could animate a fade in shake (or similar package assuming you have access to it) to control z depth image. I did this on my masters project and it worked a treat. It would mean you only need to render one image.

Do you have access to any comping software?


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 5 09-01-2004 , 02:54 PM
Registered User
Join Date: Jan 2004
Posts: 17
I do have After Effect production bundle 6.0, which of course supports z-depth. I have yet to do any 3D work in AE, but I imagine it's pretty easy as I'm pretty comfortable in AE in general.

It just seems to me that keyframing the camera parameters would be easier. You know, set a keyframe on frame 1 with focal distance = 15, move to frame 50 and set a new keyframe of focal distance 25, etc. But apparently it doesn't work that way?

Someone on another forum mentioned to use a locater and tie the focal distance to the locater. Seems overkill to me, but I admit I'm just learning this, so I'll reserve analyzing it until I'm more familiar.

Thanks for the input, I'll try the post-production method. Presumably that's going to have a slightly different look, right? Not that it really matters for what I'm doing, but I could see where someone would prefer one render look over the other.

# 6 09-01-2004 , 04:28 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
no it should look the same, and the beauty is that if you dont like the look you can tweak it without re-rendering the scene... and that's the time saving beauty of it user added image


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 7 09-01-2004 , 04:39 PM
Registered User
Join Date: Jan 2004
Posts: 17
Interesting. So is it safe to say that in general one would NOT render in Maya with depth of field, but rather just render with Z-depth and do it in post. Thus allowing the flexibility as well as time savings in renders?

I'm going to have to play with that this afternoon.

# 8 09-01-2004 , 06:01 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
damn right! I would never trust maya's DOF it takes too long and when you're done you've got dof whether you like it or not! user added image if you do it in post you can remove it, tweak it do whatever the hell you want with it. Much much more flexible user added image

Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 9 20-07-2009 , 07:07 PM
andymcbride's Avatar
Registered User
Join Date: Jul 2009
Location: atlanta
Posts: 42
I would like to see if there IS a way to keyframe the depth of field within maya...i mean..it just doesnt make sense that you couldnt. But doing it in after effects SEEMS like a solution...but for some reason i dont like the idea of doing it in AE. hmm..i will read into that too. If anyone has good links for this process please post..I will aswell.

# 10 20-07-2009 , 07:13 PM
honestdom's Avatar
The Nurb Herd
Join Date: Oct 2007
Location: London
Posts: 2,381

Originally posted by Alan
damn right! I would never trust maya's DOF it takes too long and when you're done you've got dof whether you like it or not! user added image if you do it in post you can remove it, tweak it do whatever the hell you want with it. Much much more flexible user added image

Alan

this is your answer.

# 11 23-07-2009 , 01:17 AM
Chirone's Avatar
Subscriber
Join Date: Dec 2007
Location: NZ
Posts: 3,125
A DOF in after effects or other compositing packages takes all of 2 seconds, doing it in maya takes all of... not sure how long it takes, but its certainly more than 2 seconds to see something, as stated above

you just need to have a zdepth pass rendered




that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
# 12 29-05-2018 , 09:52 PM
Registered User
Join Date: May 2018
Posts: 1
Okay I know it's been a LONG time since this post was created but I ran into this issue last night in Maya 2017 where I could for the life of me animate the DOF from in camera or with a mental ray lens bokeh. Though after much trial and error, I found a way to do it....EXPRESSION DRIVEN!

In the camera itself, if you create a new attribute called something like "dofAnimate" you can link it directly to the camera DOF focus distance or mi_lens_bokeh plane with a simple expression like this:

perspShape1.focusDistance = persp1.dofAnimate;

for an mi_lens_bokeh it would look something like this:

mi_lens_bokeh1.plane = persp1.dofAnimate;

Now you can simply keyframe the dofAnimate attribute on the camera and it forces Maya to actually animate the DOF.


On a side note, I could have easily rendered out a Z pass, but let's face it, without rendering out multiple layers of objects with their own passes, Zdefocus in Nuke looks terrible and can have broken or choppy edges especially on really deep scenes with lots of bokeh. Rendering DOF directly out of Maya always looks better even if you have to sacrifice a lot more time to do so. I hope this is helpful for anybody who runs into this issue in the future.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads