CinemachinePostProcessing force first weight to 1

In working with Cinemachine & PostProcessing package I encountered an issue with using multiple virtual camera’s with different post processing overrides. My setup is as follows:

  1. Global Virtual Camera (A)
  2. Camera Zone B (inside building)
  3. Camera Zone C (inside another area inside the building)

In blending the camera’s between B & C, I noticed that most post processing settings were “snapping” instead! I would have expected the weight of volumes to be used so I looked into the CinemachinePostProcessing code, and found this:

           CameraState state = brain.CurrentCameraState;
            int numBlendables = state.NumCustomBlendables;
            List<PostProcessVolume> volumes = GetDynamicBrainVolumes(brain, ppLayer, numBlendables);
            for (int i = 0; i < volumes.Count; ++i)
            {
                volumes[i].weight = 0;
                volumes[i].sharedProfile = null;
                volumes[i].profile = null;
            }
            PostProcessVolume firstVolume = null;
            int numPPblendables = 0;
            for (int i = 0; i < numBlendables; ++i)
            {
                var b = state.GetCustomBlendable(i);
                var profile = b.m_Custom as PostProcessProfile;
                if (!(profile == null)) // in case it was deleted
                {
                    PostProcessVolume v = volumes[i];
                    if (firstVolume == null)
                        firstVolume = v;
                    v.sharedProfile = profile;
                    v.isGlobal = true;
                    v.priority = s_VolumePriority - (numBlendables - i) - 1;
                    v.weight = b.m_Weight;
                    ++numPPblendables;
                }
#if true // set this to true to force first weight to 1
                // If more than one volume, then set the frst one's weight to 1
                if (numPPblendables > 1)
                    firstVolume.weight = 1;
#endif

At the bottom, note the #if true definition. Once I set this to false the blending seems to work as I would expect it to. However, I’m afraid of any unintended consequences that I may not be aware of. (and why this is “true by default”).

Is there a specific reason for this solution? Are there any known issues as to why this is set to TRUE? Couldn’t this just be a setting, what am I missing?

Bump!

Sorry for the delayed response.
If setting it to false fixes the problem for you, then go for it. It’s there to address a specific depth-of-field blending issue. Without it, if you have no global depth-of field set, you might get weird DoF blending. If you have a global DoF volume (or no DoF effects), you should be ok either way.

Thanks for the clarification. I am indeed using global DoF volume so all good!