Whenever I try to bake a reflection probe, I end up with the following error (full stack trace attached), and the reflection probe doesn’t end up baking:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Rendering.AdaptiveProbeVolumes.FixSeams (Unity.Collections.NativeArray`1[T] positionRemap, Unity.Collections.NativeArray`1[T] positions, Unity.Collections.NativeArray`1[T] sh, Unity.Collections.NativeArray`1[T] validity) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs:1229)
UnityEngine.Rendering.AdaptiveProbeVolumes+DefaultLightTransport.Step () (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs:121)
UnityEngine.Rendering.AdaptiveProbeVolumes.BakeProbes (UnityEngine.Vector3[] positionValues, UnityEngine.Rendering.SphericalHarmonicsL2[] shValues, System.Single[] validityValues) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.LightTransport.cs:640)
UnityEngine.Rendering.AdaptiveProbeVolumes.BakeAdditionalRequests (System.Int32[] probeInstanceIDs) (at ./Library/PackageCache/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs:1472)
UnityEditor.Rendering.HighDefinition.HDBakedReflectionSystem.BakeProbes (System.Collections.Generic.IEnumerable`1[T] bakedProbes) (at ./Library/PackageCache/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs:446)
UnityEditor.Rendering.HighDefinition.HDBakedReflectionSystem.BakeAllReflectionProbes () (at ./Library/PackageCache/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs:70)
UnityEditor.Experimental.Rendering.ScriptableBakedReflectionSystemWrapper.Internal_ScriptableBakedReflectionSystemWrapper_BakeAllReflectionProbes () (at <2ae8de24a0b242bca0c13cf1c78f500e>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
After sniffing through the code I’ve narrowed down the likely culprit to a static variable defined in the ProbeGIBaking file - m_BakingBatch that is likely not being set when baking reflection probes (specifically, while fixing seams). FWIW I don’t get this same error popping up when fully generating lighting, but at the same time fully generating lighting also appears to completely clear reflection probe data and doesn’t bake it afterward. I tried disabling APV, yet still end up with the same error for some reason. I did a full reimport on one of my projects with this issue and it didn’t appear to fix the problem.
This is occurring on multiple projects that have existed for several years now. Can anyone help with this?