MRTK异常:Unable to load controller models; loading alternate

异常信息:Unable to load controller models; loading alternate

开发环境:

  Windows:Windows 10家庭普通版 版本号:1803

  Unity3D版本:2017.4.f31

  Windows Mixed Reality for StreamVR版本:1.0.155

  SteamVR版本:1532655920

  MixedRealityToolkit-Unity版本:2017.4

  VR设备:惠普 Windows 混合现实头戴式显示器

异常原因:

      MixedRealityToolkit-Unity内的脚本MotionControllerVisualizer.cs的作用是在场景中加载手柄的模型。在Unity编辑器内,加载模型主要是调用如下动态链接库内的方法。当无法获取模型,就会返回false,并报出如上文所示的异常。

#if UNITY_EDITOR_WIN
        [DllImport("EditorMotionController")]
        private static extern bool TryGetMotionControllerModel([In] uint controllerId, [Out] out uint outputSize, [Out] out IntPtr outputBuffer);
#endif

Dll内的方法是直接调用的,如果出现异常,有可能是系统配置的问题。笔者解决这个异常的方式是重新安装驱动:Windows Mixed Reality Motion Controller model drivers 

解决办法:

1.在网址上下载驱动,两个文件都下载。下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=56414

2.解压两个文件夹;

3.在MotionController065A文件夹内,鼠标右键MotionController065AModel.inf文件,选择安装选项;

4.在MotionController065C文件夹内,鼠标右键MotionController065CModel.inf文件,选择安装选项;

猜你喜欢

转载自blog.csdn.net/weixin_38558469/article/details/81275647
今日推荐