Switching "Track to" on a camera
brainmuffin
Posts: 1,205
I've tried several different ways and none of them have worked so far. I want to track an object with the camera until it crosses paths with another one, then switch and follow the second. I've tried changing the "track to" in a keyframe, but that value doesn't seem to be update able and the change affects the whole animation. I've also tried adding a second "Track to" constraint to the camera, pointing at the second object, and adjusting the Influence values at the cross point. I see the keyframe in the animation, but again the values stay changed for the whole thing. While I know I can do to renderings and make the change in post, I'm trying to do this all in Blender. Anyone have any other ideas?
Comments
maybe create an invisible object that follows the first object to the shift point and then follows the second object, and track to that instead, not sure how viable that would be in your case though.
I use constraints a lot, but tracking the camera isn't something I've done recently (if ever?).
... But that's where it is.
Two 'Track To' constraints, one targetting each object, is the way to go I think. Then, although I imagine keyframing the influence value would work, why not just keyframe the enabled/disabled state of each constraint?
A quick test - green cube moves to the right then back to the left passing in front of the blue cube. Blue cube starts to move up when the green cube crosses in front of it at fram 71. Camera tracks green cube to frame 71, then the blue cube, with 'Track To' for green cube disabled at frame 71 and 'Track To' for blue cube toggled from disabled to enabled at that point. The camera is stationary to simplify things.
Probably the constraint on the blue cube takes over in any case when it becomes enabled, but to ensure no effect by the 'Track To' on the green cube I disabled it.
Hmm...this is an interesting idea. Techincally, the camera is actually following an empty that is attached to the drone. It is a square slighly larger than the drone. I'll have to experiment with that.
I'll give this a try as well. I also need to make sure the first keyframe is setting the values properly. I think that might be why a change effects the entire animation.
I am still trying to do this. Nothing has worked so far.
@brainmuffin Use two cameras placed at the same location. Camera one tracking object a and camera two tracking object b. Switch cameras when the objects cross.
https://www.youtube.com/watch?v=Q8acK_aa4jQ
That will probably be more jarring than how I have the camera switching now. An 8 year old Blender tutorial.... what's the likelihood it doesn't work anymore. I've had zero luck with videos more than 6 months old.
I think the difficult you're facing really just emphasizes some things need to be done by hand. Nonetheless, I found a solution:
Create an empty with two "Child Of" constraints. Turn off everything in the constraints but the location and animate the influences so it's smoothly "handed off" between the two objects. Then put a Damped Track constraint on your camera with the empty as the target and "-Z" as the tracking axis.
Just tried it, works 100%.
However, it does make the camera go topsy-turvy as it tries to follow the objects. I couldn't figure that part out. If you can't, you might just need to keyframe the camera's rotation. so it remains upright.
Yeah, the "topsy-turvy" camera is what I'm combatting, though I have it smoother than it has been. You may be correct though. I may need to keyframe values for rotation when it get close to the handoff point.
You are right @brainmuffin, the solution I proposed produces a rather jarring effect.
@skinlizard's suggested solution works well. Curious to know what issues you ran into when you tried that.
Haven't tried it yet as Blender stopped rendering stills for that scene. I figured out that problem. Now my poor Linux box is out of RAM. I have an 8GB upgrade on the way.