Mixedrealitytoolkit-unity: Articulated hand pose loading is broken is broken in editor if MRTK not in Assets root

Created on 17 May 2019  路  2Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Describe the bug

ArticulatedHandPose.cs is expects the hand poses to be stored in "Assets/MixedRealityToolkit.Services/InputSimulation/ArticulatedHandPoses/"

That said, I stored the MRTK in a sub folder so as to not clutter my project with all the MRTK folders at the root. Because of this, the articulated hands fail to load.

Moreover, private static ArticulatedHandPose LoadGesturePose(GestureId gesture, string filePath) does not consider the possibility that the file might not exist, and so an error is thrown while that could be avoided by checking if the file it's trying to open exists in the specified path.

To reproduce

  1. Move the MRTK root folder to a sub folder
  2. Try and load a scene where the articulated hand joints should appear, like the hand interaction scene.
  3. Articulated hand pose loading will throw an error, and hand joints will not appear in the editor.

Expected behavior

Articulated hand poses should not have a hardcoded path to loading the json with the hand data.

Rather, StreamingAssets should be used, as it allows you to specify a path relative to the it, without preloading anything into memory. StreamingAssets can be arbitrarily nested in hierarchies, and you can have more than one such folder. It is the preferred method for dynamically loading in non-unity assets at runtime.

Here is the documentation on streaming assets
https://docs.unity3d.com/Manual/StreamingAssets.html

Your Setup (please complete the following information)

  • Unity Version 2018.3.81
  • MRTK Version v2.0 latest dev as of May 17 2019

Target Platform (please complete the following information)

  • HoloLens
  • HoloLens 2
  • WMR immersive
  • OpenVR
4 - In Review Bug D365 Input Simulation Urgency-Soon

Most helpful comment

We should fix this soon, because we know that lots of customers import MRTK into the non-root folder

All 2 comments

We should fix this soon, because we know that lots of customers import MRTK into the non-root folder

When consuming the NuGetized version of MRTK I'm seeing this same issue. It looks like it stems from this line in ArticulatedHandPose.cs.

Was this page helpful?
0 / 5 - 0 ratings