But the behaviour I’m getting is not consistent. When I change the value on one virtual camera, it changes the values globally.
I need 3 different “lenses” with the appropriate DoF.
On one camera I need to “pull focus” as the character moves near a close-up camera and without “pulling focus”, the character occasionally falls out of the range of focus.
I have one Cinemachine Brain and 3 virtual cameras.
I use the postprocessing stack v2.
I have one global post processing profile.
I have imported the CM PostProcessing V2 adapter package.
I have added the Cinemachine Post Processing extension to each camera.
Problem 1:
Setting the Depth of Field on each Virtual Camera GameObject sets the DoF values globally; so when I set VCam1, it overrides the values of VCam2 & 3. this just seems to be a local way of setting the global value. How do I set the “lens” on each individual VCam?
Problem 2:
I assume I can find a way to animate the DoF somehow, but currently the Camera track doesn’t have an animate button… How can I “follow focus” or “pull focus” on a moving character without finding some sort of way to hand animate the DoF? Can I target a bone or parented empty?
Now, this doesn’t affect any of the other camera focus settings - those would have to be animated … somehow. As the Cinemachine Post Processing script seems to access the Post Processing Profile - which is an ASSET, the properties on the VCam don’t seem animatable from an animation track in timeline.
Right now I’m limping along with the same “Lens” on all of the cameras as the checkbox sets only the focal distance.
The way to have individual Post Processing effects for each vcam is to make a separate PP profile for each one, with the settings that you want to override the global profile with.
Let’s sat you have a global profile G, with a focus setting, color correction, and a vignette. Now you have vcam A, and you want a different focus setting but you want to keep the other effects. You need to create a new PP asset for vcam A, containing only the focus settings you want. When vcam A blends in, that effect will blend in too, overriding the global setting for that effect.
It’s true that because the PP settings are assets you can’t animate their fields them timeline. CM has made a special case for focus distance, because it’s such a commonly requested thing. Under the hood, it creates dynamic assets for the vcams that want to manipulate the focus distance.
If you do want to animate other PP effects, one possible way is to create a global PP volume containing the destination settings, and use the timeline to animate its weight, effectively lerping it in. You can do similar things with multiple vcams, each with customized profiles. That works well, because the settings are tied to vcams and lerp in along with them.
One note about the CM PP extension: the focus tracks target setting provides an “offset” field. When you have a LookAt target on your vcam, that field is the offset from the target’s transform, i.e. 0 will focus exactly on the target, wherever it happens to be. When there is no LookAt target, that field is the offset from the vcam, so a setting of 10 would set the focus distance to 10.
Does this architecture still apply? I can get it working all fine and dandy, but when I want to blend between my profiles with Timemachine, I get wierd hickups. All effects blend fine, except for Depth of Field. Somewhere in the middle of my transition from profileA to profileB, the Depth of Field snaps and jumps from one to the other- no blend at all.
The solution is to put a DoF in the global profile on the main camera. This is because the math in DoF requires a default setting through which it can pass when blending between 2 other settings.
Maybe it has to do with your specific settings. As an experiment, could you set your main camera’s DoF settings to midway between the settings for vcam A and vcam B? Does the problem go away?
Issue : To change each camera shots Focus / aperture / focus length at run time.
I use the Timelines new feature called " Signals "
I create a signal in the timeline (its in the Marker drop down ) Each signal trigger an event on the main camera change the Depth of Field components Focus Dist. / Aperture / or Focal Length at any given time on the time line.
Signals also have " REACTORS " which simply call my script which changes values within thew Depth Of Field
Focus Distance
Aperture
Focal Length
My Script is placed on the Main Camera
public class CameraFocus : MonoBehaviour
{
PostProcessVolume m_Volume;
DepthOfField d_Depth;
public void Start()
{
Debug.Log(“Starts Here”);
d_Depth = ScriptableObject.CreateInstance();
d_Depth.enabled.Override(true);