Camera Object Focus Tracking

I think Corona has this but its been years since I used it. Possible to add a feature to the VrayCamera which would allow me to select an object in the scene and have it auto focus on the object throughout an animation?
For example, I have a car driving and camera moving quickly, id love to select headlight glass and have camera always have the glass as focus point no matter what?

Why not just link the target to the object?
From some quick research I don’t think Corona had/has anything that automatically does this, other than a script for still frames, though if it did it would have to be a similar link
in any case, no?

Well if I link target to object it will force my camera to always look at it, when I do my car chase animations and such I want the car to fly past camera and feel natural. Here is the option in Corona,

​

Ah ok, it’s a DOF function. It should be simple enough to link the same parameter to an object with parameter wiring or possibly even a linked dummy.
I’ll have a look in the morning unless you figure it out in the meantime.

Interesting feature in Corona and could be useful in Vray too. You can achieve similar functionality by assigning a “Float Script” controller to the “Focus Distance” of the vray camera in the track view. Then in the script box that opens enter “Distance $VrayCam001 $Sphere001” for the Expression where VrayCam001 and Sphere001 are the scene camera and whatever object you want to link to.

oooo!!! Thank you for this. Going to give it a shot later on today.
Have a wonderful weekend!

Very clever. :slight_smile: I wish I could script.
I will still see how achievable it is without, as an exercise, as it’s clearly quite an obvious and useful thing to have as a tool.
Maybe a dev or too could look at implementing it as an option, given that the script part appears trivial.

In the past I recall having to tediously manually keyframe focus pulls, so if this is animatable also then that’d be cool.

Very clever. :slight_smile: I wish I could script.Honestly I googled the distance maxscript and the rest was just setting up the controller.

​In the past I recall having to tediously manually keyframe focus pulls, so if this is animatable also then that’d be cool.It works in animations as it constantly updates but it’s not really keyable if that’s what you’re after.

It would need to be changeable though, in a case where the focus is ahead and then e.g. behind or sufficiently rotated from the previous focus.
In the OP’s car chase scenario, maybe the camera needs to reverse and look at the pursuer for example. Just a thought - it’s useful regardless :slight_smile:

Hehe, in realtime I just found this also https://www.scriptspot.com/3ds-max/scripts/vray-focal-controller

But where’s the focus done on the node?
At the pivot? At the bBox center?
I ask as both are prone to failure when automated.
To work, it has to focus on the closest part of the node, intersecting some ray (screen center? anywhere?).

The node-based mode would surely need an animatable bias (the node may have parts coming closer or going further from the camera, while the pivot stays at the same distance. think a rotating teapot. OR simply the user may want to not focus on the closest part of the geo.), which however would then bring the user back into manually animating to be as precise as needed.

I would suggest something else entirely: isolate the part of scene that’s relevant, turn animate on in the Max UI, start IPR in the VFB and just alt+click in the VFB to pick your focus at a given frame.
This way, it’s as accurate as you’ll want it (by the pixel in space, and down to where you can add a keyframe in time.), and is independent of node bounding box or pivot location.
If done right, the above will take a handful of seconds to set up, without particular surprises lying in wait when one renders the sequence, and will provide for a neat animation curve for the focus distance on the relevant camera(s).

it’s all better now, and these are unlikely to work in the state they were left, but hey. :slight_smile:
https://www.scriptspot.com/3ds-max/scripts/leles-vray-tools

Btw, the option does make a lot of sense if used with nulls/dummies and other such nodes, more than with geometry.

Hi guys! First time posting here, but it got me interested as I would love to see this being implemented too.

Corona has an override function for DOF that we can enable and then assign any kind of object and it will keep focusing on that area.

I also work in the automotive area and when I was using Corona, I would create a dummy/pointer helper and simply assign the override function to it, it worked like a charm. But now I switched to VRay and I’m missing that for my animations.

I did a script with the help of ChatGPT that automatically creates a targeted VRayCam and then a point helper that serves as a focus distance. But it is too much of a hassle to do and a lot of lost time.

It’s far easier if you know your way around Max and controllers.​

3dsmax_EXWuagPn1Y.gif​

Thank you, I must’ve missed the reply, but that does work very well. I still wish the process was easier as a “override focus”, “pick object” kind of thing.

It’s not a big deal but it would definitely help streamline things a bit, or maybe I’m being too picky, or getting old. Haha! Thank you once again.

It has definite benefits done the way you suggest, it’s being considered, regardless of the workaround above.