Announcement

Collapse
No announcement yet.

Camera Object Focus Tracking

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    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?
    https://www.behance.net/bartgelin

    Comment


    • #3
      Originally posted by fixeighted View Post
      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,
      Click image for larger version

Name:	image.png
Views:	85
Size:	38.2 KB
ID:	1222926

      Comment


      • #4
        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.
        https://www.behance.net/bartgelin

        Comment


        • #5
          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.
          www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.

          Comment


          • #6
            Originally posted by dlparisi View Post
            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!

            Comment


            • #7
              Very clever. 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.
              https://www.behance.net/bartgelin

              Comment


              • #8
                Very clever. 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.
                www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.

                Comment


                • #9
                  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

                  Hehe, in realtime I just found this also https://www.scriptspot.com/3ds-max/s...cal-controller
                  https://www.behance.net/bartgelin

                  Comment


                  • #10
                    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).
                    Last edited by ^Lele^; 02-01-2025, 08:23 AM.
                    Lele
                    Trouble Stirrer in RnD @ Chaos
                    ----------------------
                    emanuele.lecchi@chaos.com

                    Disclaimer:
                    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                    Comment


                    • #11
                      Originally posted by fixeighted View Post
                      Very clever. I wish I could script.
                      it's all better now, and these are unlikely to work in the state they were left, but hey.
                      https://www.scriptspot.com/3ds-max/scripts/leles-vray-tools
                      Last edited by ^Lele^; 03-01-2025, 02:39 AM.
                      Lele
                      Trouble Stirrer in RnD @ Chaos
                      ----------------------
                      emanuele.lecchi@chaos.com

                      Disclaimer:
                      The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                      Comment


                      • #12
                        Btw, the option does make a lot of sense if used with nulls/dummies and other such nodes, more than with geometry.
                        Lele
                        Trouble Stirrer in RnD @ Chaos
                        ----------------------
                        emanuele.lecchi@chaos.com

                        Disclaimer:
                        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                        Comment

                        Working...
                        X