microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

KnowFolder 3DModels path changing from an HoloLens to an other #9773

Closed Kent1LG closed 3 years ago

Kent1LG commented 3 years ago

Describe the bug

I'm currently working on a project where I need to get every file of the 3DModels folder. I did it and it's working fine, until I deploy the application on others HoloLens.

I find that the path return by KnowFolders.Objects3D is not the same depend of the HoloLens used. So I just try to get 3D models from an empty folder... the wrong one obviously.

Here is the path I got with the HoloLens where it's working well : U:\Users\HoloLens2–10\3D Objects And one where it's not : C:\Data\USERS\Hololens2-01\3D Objects

To reproduce

Steps to reproduce the behavior:

  1. Create an HoloLens application
  2. Create a script and put this code where you want:

`string path = string.Empty;

if WINDOWS_UWP

        UnityEngine.WSA.Application.InvokeOnUIThread(async () =>
        {
            try{
                StorageFolder storageFolder = KnownFolders.Objects3D;
                path = storageFolder.Path;
                Debug.Log("internal models path : "+path);
            }catch(Exception e)
            {
                path = string.Empty;
                Debug.Log("issue getting internal models : "+e.Message);
            }
        }, true);

endif

    if (!string.IsNullOrEmpty(path))
    {
        Debug.Log("Path of 3D Models : "+path);
    }`
  1. Read the logs

Expected behavior

Get the same 3D Models path whatever the HoloLens used.

Your setup (please complete the following information)

Target platform (please complete the following information)

keveleigh commented 3 years ago

To clarify: KnownFolders.Objects3D isn't always pointing to a valid / the correct folder? Can you report which versions of Windows each device is running please? It's also worth reporting this via the Feedback Hub.

Kent1LG commented 3 years ago

Hey, yes you right, is not pointing to the correct folder, and not the same depend on the HoloLens.

Here are the windows versions : The one's working well : 20341.1000.arm64fre.fe_release_svc_sydney.210423-1109 The bad one : 19041.1144.arm64fre.vb_release_svc_sydney_rel_prod.210405-1628

Thank you very much for your help.

Kent1LG commented 3 years ago

Quick update :

I tried with the last update : 10.0.20346.1002 and it's not working either.

MaxWang-MS commented 3 years ago

Hi, it seems that the issue you are encountering is external to MRTK. As @keveleigh mentioned, please submit a bug report to the appropriate team through feedback hub on your HoloLens device.