Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Exporting World Anchors returns access denied

Discussion in 'Windows Mixed Reality' started by DevTVR, Oct 4, 2019.

  1. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    3
    I am developing a VR UWP application on Windows 10 for the new HP Reverb which has inside out tracking.

    WorldAnchors are working perfectly in editor and with deployed apps, trying to export them however gives me the following error.

    Using WorldAnchorTransferBatch.ExportAsync() returns

    SpatialAnchorTransferManager denied access to WorldAnchor serialization UnityEngine.XR.WSA.Sharing.WorldAnchorTransferBatch:ExportAsync_Internal(WorldAnchorTransferBatch, SerializationDataAvailableDelegate, SerializationCompleteDelegate) UnityEngine.XR.WSA.Sharing.WorldAnchorTransferBatch:ExportAsync(WorldAnchorTransferBatch, SerializationDataAvailableDelegate, SerializationCompleteDelegate)

    using this code:

    Code (CSharp):
    1. private void SetExportAnchors()
    2.         {
    3.             anchorIDs = worldAnchorManager.AnchorStore.GetAllIds();
    4.             WorldAnchorTransferBatch transferBatch = new WorldAnchorTransferBatch();
    5.             for (int i = 0; i < anchorIDs.Length; i++)
    6.             {
    7.                 GameObject myObject = GameObject.Find(anchorIDs[i]);
    8.  
    9.                 if (myObject) {
    10.                     transferBatch.AddWorldAnchor(anchorIDs[i], worldAnchorManager.AnchorStore.Load(anchorIDs[i], GameObject.Find(anchorIDs[i])));
    11.                 }
    12.             }
    13.             Debug.Log("Serializing");
    14.             WorldAnchorTransferBatch.ExportAsync(transferBatch, OnExportDataAvailable, OnExportComplete);
    15.         }
    Also tried the azure spatial anchors example project with the same outcome. The Error reads "Access denied to spatial anchor exporter. Ensure your OS build is up to date and the spatialperception capability is set."

    Has anyone an Idea what I'm doing wrong? Or someone knows an alternative way to share world anchors on UWP?

    thanks

    Spatial Perception is checked in the "capabilities".
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    563
  3. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    3
    hey joejo, thanks for the answer, I do have the "Spatial Perception" enabled, in the Unity player settings as well as in the app manifest in visual studio :/ That's why I'm at a bit of a loss to why it doesn't work....
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    563
    I just saw the HP Reverb bit above. I'm pretty sure that just because it has Inside-Out tracking doesn't mean it's going to support spatial mapping. I believe this API set is only going to work on HoloLens devices.
     
  5. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    3
    It's true that spatial mapping does not work on the reverb (which is stupid, since it has the same inside out capabilities as the Hololens afaik).

    Still, spatial Anchors are working perfectly, as expected according to Microsofts own docs. Also people have gotten Inside Out Immersive devices to work with Azure Spatial Anchors.

    So I'm thinking that either I'm missing something, or it isn't as easy in the end as it's should be :(