Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Assets\XR\Settings\Open XR Package Settings.asset keeps modifying itself

Discussion in 'VR' started by emrys90, May 28, 2021.

  1. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    This file keeps modifying itself by reordering its list of features, no idea why, I'm not changing anything. It's a pain for version control seeing it constantly change, and will be a big source of merge conflicts. Any ideas how to resolve this?
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Please create a simple, stripped down repro project and file a bug. Then please copy the case id here to this thread.
     
  3. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I think it might be related to running two instances of the project through symbolic links, so not really a repro I can create for you on that. I am doing this because of multiplayer development, needing a server and client running.
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Unfortunately I don't think there is much we can do about that. You have two unity instances that are touching the same asset at the same time and there is no way to protect against that sort of shared resource activity.

    My only suggestion would be to move the XR settings out to the actual projects directy. This will increase your overhead on making settings related changes but you won't end up with it the issue you have now.
     
  5. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    This is the only asset that has this issue though. All other settings files in Unity do not have any issues, and haven't for the 9 months that I have been developing this project. It's only after updating to OpenXR/XR Plugin Management that this issue occurs, and only with this one file.
     
  6. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    What were you using before OpenXR?
     
  7. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I was using the legacy VR in 2019.4, recently updated the project. I just mentioned that so you're aware it is possible, since all the other setting files in Unity do not cause issues. There's just something about this particular file that is causing the ordering of features to not be deterministic between projects or something I'm guessing.
     
  8. darkdescendant

    darkdescendant

    Joined:
    Feb 8, 2019
    Posts:
    5
    I asked as I was wondering if it happens with ANY provider and settings, or OpenXR specifically.
     
  9. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Nope, its specifically the file named "Open XR Package Settings.asset" that has this issue. All other Unity asset files do not have this issue. My guess is that the enabled "features" in this are generated and randomly ordered in a way that is not deterministic between two different Unity projects, and so its constantly reflecting that its changing in version control because the options are being reordered.

    I have not tested whether other XR Plugins have this issue or not, but it should be possible for the issue to be fixed. It just needs the randomness of the ordering to be resolved.
     
  10. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    After looking through the code, I believe the issue is related to FeatureHelpers.GetAllFeatureInfo. In the version I am on its line number 225, which is
    "openXrSettings.features = all.ToArray();"
    This needs to be updated so that it is always guaranteed to be reorderered in the same way. I believe that would resolve the issue.
     
  11. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    That is something we could look into resolving. Since you have a repro case with your setup, if you want you could change that locally and see if it fixes it.

    Maybe to
    all.OrderBy(f => f.name).ToArray()
     
  12. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    It was pointed out to me that changing that locally may not be that easy. You would have to unzip and untar the package do a different location on your hard drive and then add that package using "add From disk". Then you should be able to make that change since it is in the C# files.
     
  13. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Yeah, I can do that as a test to see if it fixes it, but hopefully it'll get fixed in the package so its easier to maintain future updates.
     
  14. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    The change is already made, but it would be nice to confirm it is actually a fix if possible.
     
  15. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    Great, thank you! I will try it out soon and let you know.
     
  16. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    169
    My team is also experiencing this issue. Unity 2020.3.24f1, XR Plugin Management 4.2.0, OpenXR 1.2.8.

    We're not using symbolic links or doing anything non-standard.
     
  17. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Have you tried OpenXR 1.3.0 or 1.3.1 ?
     
  18. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    169
    Not yet - will try ASAP.
     
  19. Lyje

    Lyje

    Joined:
    Mar 24, 2013
    Posts:
    169
    I've not yet tried a newer version, but in the meantime I noticed this warning:

    Importer(NativeFormatImporter) generated inconsistent result for asset(guid:b073971aece255242acace4421e58a0f) "Assets/XR/Settings/Open XR Package Settings.asset"
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
     
  20. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I actual
    I actually just saw that myself, we will look into it. Thank you
     
  21. fstorehaug

    fstorehaug

    Joined:
    Apr 3, 2017
    Posts:
    10
    had the same issue on 1.6.0. Importing the samples fixed it for me, somehow.
     
  22. unity_B159A46BF5F15B9376DA

    unity_B159A46BF5F15B9376DA

    Joined:
    Mar 6, 2023
    Posts:
    7
    How i can import samples? Where i can find them?
    Same problem, slow 'Importing Open XR Package Settings' On Android build
     
  23. fstorehaug

    fstorehaug

    Joined:
    Apr 3, 2017
    Posts:
    10
    Windows -> package manager -> OpenXR Plugin. there's a dropdown called "samples" at the bottom and an import button.
     
  24. nicholasmillersus

    nicholasmillersus

    Joined:
    Jun 23, 2022
    Posts:
    2
    Importing samples did not work for me, I still get the re-ordering with 2021.3.16f1 OpenXR 1.5.3