microsoft / OpenXR-Unity-MixedReality-Samples

Sample Unity projects to demo how to use OpenXR plugin in Unity for HoloLens 2 and Mixed Reality headsets
MIT License
245 stars 70 forks source link

Project validation spam errors in the console when no main camera #174

Closed anonymous2585 closed 5 months ago

anonymous2585 commented 6 months ago

Hi,

I just updated to Unity 2023.2.12f1, so OpenXR updated automatically to 1.10.0. I manually updated the microsoft OpenXR plugin to 1.10.0.

In our application, there is a root scene that load sub-root scene depending on the plateform. The main camera is in the sub-root scene, so most of the time, I don't have a main camera open in the editor.

When opening the OpenXR Project Validation, it spam this error, because there is no main camera:

NullReferenceException: Object reference not set to an instance of an object
Microsoft.MixedReality.OpenXR.Editor.PlatformValidation+<>c.<GenerateCameraFlagsRule>b__35_1 () (at ./Library/PackageCache/com.microsoft.mixedreality.openxr@6b31efb96f12/Editor/Settings/PlatformValidation.cs:465)
Unity.XR.CoreUtils.Editor.BuildValidator.GetCurrentValidationIssues (System.Collections.Generic.HashSet`1[T] failures, UnityEditor.BuildTargetGroup buildTargetGroup) (at ./Library/PackageCache/com.unity.xr.core-utils@2.3.0/Editor/ProjectValidation/BuildValidator.cs:94)
Unity.XR.CoreUtils.Editor.ProjectValidationDrawer.UpdateIssues (System.Boolean focused, System.Boolean force) (at ./Library/PackageCache/com.unity.xr.core-utils@2.3.0/Editor/ProjectValidation/ProjectValidationDrawer.cs:475)
Unity.XR.CoreUtils.Editor.ProjectValidationSettingsProvider.OnInspectorUpdate () (at ./Library/PackageCache/com.unity.xr.core-utils@2.3.0/Editor/ProjectValidation/ProjectValidationSettingsProvider.cs:45)
UnityEditor.SettingsWindow.OnInspectorUpdate () (at <3e46df4d8aed4ee0a868f68610838aae>:0)
UnityEditor.HostView.OnInspectorUpdate () (at <3e46df4d8aed4ee0a868f68610838aae>:0)
AMollis commented 6 months ago

@marlenaklein-msft can you please investigate

marlenaklein-msft commented 5 months ago

@anonymous2585, @AMollis. Thanks for reporting this! The issue is fixed in the1.10.1 patch release