如何在不打开手部网格可视化选项的情况下从 Hololens2 获取手部网格数据

How to get hand mesh data from Hololens2 without turning on Hand Mesh Visualization option

我尝试使用 MRTK V2 和 Unity C# 从 Hololens2 获取手部网格数据。 现在,我可以通过打开手部网格可视化选项 并引用 MRTK HandTracking guide.

来获取手部网格数据

不幸的是,可视化(绘制手CG)工作量很大。 所以,我想在不打开手部网格可视化选项的情况下获得手部网格,但是由于 关闭 手部网格可视化选项,OnHandMeshUpdated 函数未被调用。

有谁知道如何在不打开手部网格可视化选项的情况下从 Hololens2 获取手部网格数据?

Hand Mesh Visualization option

MRTK 不直接提供此功能。根据MRTK-Unity源码查看代码line 163 of BaseHandVisualizer class, you will find the majority of jobs are processed in the OnHandMeshUpdated event handler. When the current hand mesh is updated based on the passed-in state of the hand, OnHandMeshUpdated method will be invoked with HandMeshInfo event data. Once Hand Mesh Prefab field in [InputSystem]->[Hand Tracking] is set as "None", MRTK will not instantiate handMeshFilter according to the conditional statement. But the hand mesh related data will be easily accessible from the event data. Check out the class definition of HandMeshInfo here.