I’m trying to get UnityEngine XR VisionOS’s mesh classification working, but I’m running into this runtime error. Anyone have any tips on how to diagnose the problem and fix it??
Possibly related to a script I added to the scene. I explain it in my reply here.
libUnityVisionOSMock is something we use internally to test the plugin in the Editor. You probably just want to avoid calling those methods in the Editor, since they won’t have an effect and won’t work with XR simulation.
From your other post that you linked to, you say you commented out the #if UNITY_IOS preprocessor directives. I’d recommend you turn them into #if UNITY_IOS || UNITY_VISIONOS, or just repurpose them to work for just visionOS. We still need to update those samples to work on visionOS. You’ll need to add extra prefabs for the extra classifications that you get on visionOS (or just have them all fall back to an iOS classification).
Thanks so much for the reply!
About libUnityVisionOSMock, we traced it to the functions called within GetFaceClassifications. Namely, ar_mesh_anchor_get_geometry and ar_mesh_get_classificaiton. I wonder if it’s because we were running it on the editor without the preprocessor directives.
The headset doesn’t throw any DLL errors, but it doesn’t classify any faces. We narrowed it down to faceClassifications.Length <= 0 being true and thus returning without classifying any faces. It’s not throwing any DLL errors on the headset…does this mean that the headset is simply failing to classify any faces?
Do you think it could be related to the issue you mentioned earlier, where visionOS has a bug with handling meshes with no classification? If so, do you remember how you fixed the bug??
Just for extra information, the only modifications we made were adding the extra prefabs (copied from the original prefabs in the sample scene), giving them the same shader, adding the extra fields to the script, and increasing the number of classifications from 8 to 20.
As for the preprocessor directives, we added them back in!
Hi @mtschoen out of curiousity, do you know what version of Polyspatial you got mesh classifications working on? I’m working on this project with Miru and am wondering if you think this is an issue that’s resulting from Polyspatial version 1.1.4? Thanks.
It was way back before we even shipped the packages. But nothing has changed in the meshing code since then. I do remember running into trouble with meshes that had no classifications, as you say, but I don’t think there was anything else. When you inspect the result of GetFaceClassifications on device (like printing it out or using the debugger), are there valid values in there?
The length of var faceClassifications = meshSubsystem.GetFaceClassifications(meshId, Allocator.Persistent);
<= 0 for us… is it possible to have valid values in faceClassifications if its length is <= 0?
@mtschoen Hi there, I just wanted to throw in some updates here. So we’re still trying to get this mesh classification functionality working. I’ve tried updating our Polyspatial version from 1.1.4 to 1.1.6 but no luck. The error it throws is more or less the same. WRG to your last post, the DLL error is a compilation error so I don’t think we get to the point of running the program just yet. Did you ever have any luck on your end getting Mesh Classifications working since then? Thanks.