Search Unity

XRDevice.model replacement?

Discussion in 'AR/VR (XR) Discussion' started by jonagill_rr, Apr 9, 2020.

  1. jonagill_rr

    jonagill_rr

    Joined:
    Jun 21, 2017
    Posts:
    54
    I'm upgrading our VR project to Unity 2019.3, and I'm trying to replace our references to the obsolete XRDevice.model API. The documentation suggests I should use InputDevice.name, but in my testing, that returns a different value than XRDevice.model gives.

    https://imgur.com/QmZPAv0

    Notice that XRDevice.model correctly recognizes my device as a Rift S, but InputDevice just returns Rift across all its nodes.

    Possibly this is just a bug in the name that InputDevice returns?
     
  2. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    Yes, this is a bug (I remember the Unity team commenting on this a few weeks ago in one of the threads). If I remember correctly, they said they'll update/change some of the names soon. IIRC ... the Quest was being detected with a magic number that only worked for a beta / early copies of the Quest drivers, and Oculus doesn't send that magic number any more).

    (but also: some names are now obsolete: e.g. Quest controllers aren't specifically Quest-only, so ... Unity needs to report them generically as Oculus Touch, right?)
     
    ROBYER1 likes this.
  3. jonagill_rr

    jonagill_rr

    Joined:
    Jun 21, 2017
    Posts:
    54
    Thanks for the info! Seems like it doesn't hurt anything to keep calling XRDevice.model, so maybe I'll do that for now and then swap to the new API when it's more mature in 2020.
     
  4. Alex_Heizenrader

    Alex_Heizenrader

    Joined:
    May 16, 2019
    Posts:
    95
    And what is the substitute in 2020? Honestly these changes are very annoying
     
    arufolo, culleycdl and ROBYER1 like this.
  5. atupuxi

    atupuxi

    Joined:
    Jun 14, 2021
    Posts:
    1
    Use the new InputDevice.name API.
     
  6. vicobill

    vicobill

    Joined:
    Aug 28, 2019
    Posts:
    1
    Maybe `XRSettings.loadedDeviceName`?
     
  7. Pinkuboxu

    Pinkuboxu

    Joined:
    Mar 20, 2014
    Posts:
    54
    InputDevice was already mentioned in the OP as not returning the proper analog to XRDevice.model, so no.

    That only gives you the basic name like "occulus" not the actual type or model.
     
  8. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    Unity's forum doesn't allow reporting more than 1 spam every 25 seconds. Facepalm, Unity, facepalm - who are you trying to protect here?
     
  9. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    The moderators. People abuse the report system. You don't see this. Spam deleted.
     
    a436t4ataf likes this.
  10. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
    OT, but ... maybe ... not imposing that limit on accounts that have been active for 10 years without (as far as I know :)) ever being reported for spam might be OK? :). Spammers and spam sucks though, thanks for clearing it out, wish we didn't all have to live with this trash :(.
     
  11. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Yep, it's just everywhere! These forums, email, text messages. Yesterday I had a Strava friend request which was essentially a porn site. :(
     
  12. boissieu

    boissieu

    Joined:
    Oct 3, 2013
    Posts:
    3
    Hi,
    got the same issue and using OpenVr / SteamVR, I could get info from SteamVR.instance :

    SteamVR.instance.hmd_TrackingSystemName returns string "lighthouse"
    SteamVR.instance.hmd_ModelNumber returns string "Vive MV."
    SteamVR.instance.hmd_Type returns string "vive"

    Have'nt checked yet with other devices but that should do the job.
    Hope this helps