Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug XR Plugin Manager get caught in infinite loop in -batchMode

Discussion in 'VR' started by sean_virtualmarine, Jul 6, 2021.

  1. sean_virtualmarine

    sean_virtualmarine

    Joined:
    Dec 1, 2017
    Posts:
    11
    It seems like between OpenXR and the Plugin Manager wires are getting crossed and the Editor tries over and over to re-generate a settings asset that it should already have from source control.

    Here's it's loop.
    Code (CSharp):
    1. Start importing Assets/XR/Settings/OpenXR Editor Settings.asset using Guid(babb0fee2df2d3f4ebec696e0c71f433) Importer(-1,00000000000000000000000000000000)  -> (artifact id: '8c2e7226c6a2e2c1f7577c54c0231fe2') in 0.007599 seconds
    2. Import parameters got modified during import
    3. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    4. UnityEditor.XR.OpenXR.OpenXREditorSettings:CreateScriptableObjectInstance (string) (at Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/OpenXREditorSettings.cs:53)
    5. UnityEditor.XR.OpenXR.OpenXREditorSettings:GetInstance () (at Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/OpenXREditorSettings.cs:84)
    6. UnityEditor.XR.OpenXR.OpenXREditorSettings:get_Instance () (at Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/OpenXREditorSettings.cs:12)
    7. UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager:InitializeFeatureSets (bool) (at Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:223)
    8. UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager:InitializeFeatureSets () (at Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:190)
    9. UnityEditor.XR.OpenXR.Features.OpenXRFeatureSetManager:OnAssemblyReload () (at Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/FeatureSupport/OpenXRFeatureSetManager.cs:30)
    10. UnityEditor.AssemblyReloadEvents:OnAfterAssemblyReload ()
    11.  
    12. [Library/PackageCache/com.unity.xr.openxr@1.2.3/Editor/OpenXREditorSettings.cs line 53]
     
  2. sean_virtualmarine

    sean_virtualmarine

    Joined:
    Dec 1, 2017
    Posts:
    11
    Oh, it isn't just -batchMode.
    OpenXR Editor Settings.asset
    also gets overwritten just opening the Editor.
     
  3. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    We have one issue with settings getting modified fixed for the next release but I dont think it is this specifically. Could you please submit a bug using `Help -> Report a bug` to ensure this gets the proper attention? After you submit one please post the issue link you receive here so we can find it faster. If possible submitting a test project that reproduces this issue would help get it fixed faster as well.
     
  4. sean_virtualmarine

    sean_virtualmarine

    Joined:
    Dec 1, 2017
    Posts:
    11
  5. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Thank you, we will take a look
     
  6. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Can you try downgrading your XR Management package to 4.0.5 and see if it fixes this? We had another report of something similar and found it to be 4.0.6 was causing some conflict with OpenXR that was messing with the package settings. We are looking into what is going on with that right now.
     
  7. sean_virtualmarine

    sean_virtualmarine

    Joined:
    Dec 1, 2017
    Posts:
    11
    I've managed to work around it for now. Let the settings get hosed on the CI machine, then fix them at runtime.


    Code (CSharp):
    1.     public IEnumerator StartXRCoroutine()
    2.     {
    3.         var controllerFeatures = new System.Collections.Generic.List<string>
    4.             {
    5.                 "HTCViveControllerProfile",
    6.                 "OculusTouchControllerProfile",
    7.                 "ValveIndexControllerProfile",
    8.                 "MicrosoftMotionControllerProfile"
    9.             };
    10.  
    11.         //Force override of build server.
    12.         var openXRSettings = OpenXRSettings.Instance;
    13.         openXRSettings.depthSubmissionMode = OpenXRSettings.DepthSubmissionMode.Depth16Bit;
    14.         openXRSettings.renderMode = OpenXRSettings.RenderMode.MultiPass;
    15.         foreach (var feature in openXRSettings.GetFeatures())
    16.         {
    17.             foreach (string featureName in controllerFeatures)
    18.             {
    19.                 if (!feature.enabled && feature.name.StartsWith(featureName))
    20.                 {
    21.                     Debug.Log($"Feature {feature.name} found disabled in openXR settings. Enabling.");
    22.                     feature.enabled = true;
    23.                 }
    24.             }
    25.         }
    26.  
    27.         yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
    28. //...etc
    29. }