MR Example Mesh Classification not from ARFoundation Subsystems?

Hi! How do the Mesh Classification Popups work from the MR example in PolySpatial? I had thought they used ARFoundation/ARKit meshing but I am not seeing subsystem references to GetFaceClassifications() etc

The MixedReality scene in PolySpatial samples is showing plane classifications not mesh classifications. That particular example doesn’t “frack” the mesh like the one you linked from AR Foundation samples.

The ARF Sample script should work as long as you adapt it to use the ARMeshClassification enum from the visionOS plugin, instead of the ARKit plugin. Because ARKit on visionOS provides a different set of classifications than ARKit, you need a handful of extra prefabs/fields, but you can also just ignore those meshes if you want (requires a few fixes in this script). I believe there was also a bug in that ARF sample script on visionOS because it doesn’t properly handle a mesh that has no classification data, which can happen with visionOS meshes.

We haven’t yet made any updates to this repo for visionOS but we’re planning to do a first pass soon. At the moment, there are no other examples for mesh fracking on visionOS, but I can at least say I had this script working on a very early version of our plugin, and confirmed that mesh fracking worked. I’ll try to dig up my old updated version of this script to see if it worked, but all I remember doing was copy/pasting a bunch of prefabs and fields to cover the missing classifications, and fixing that “mesh has no classifications yet” bug.

ah, good to know that ARPlane has classification - i don’t have a device handy right now - do you know if mesh classification still works as well in PolySpatial 1?

I haven’t tested on the latest but I’m fairly sure it should still work. I’ve added a ticket to remind us that we should either update the ARF sample or provide a mesh fracking sample in visionOS/PolySpatial packages.

I tried modifying this script from the ARFoundation mesh classification sample with the same classification types found here, but it doesn’t seem to be working…

I’ve made duplicates of their mesh prefabs and shaders, and commented out the “if UNITY_IOS” things, but nothing shows up in the build on the Apple Vision Pro. It seems to be missing a DLL for “GetFaceClassifications()” and fails on that before it can classify anything.

Any tips?

From UnityEngine.XR.ARFoundation.Samples, MeshClassificationFracking

I changed using UnityEngine.XR.ARKit to UnityEngine.XR.VisionOS, added all the missing classifications in Enum ARMeshClassification | Apple visionOS XR Plugin | 0.1.3, updated k_NumClassifications to 20, changed UNITY_IOS to UNITY_VISIONOS and it works but is offset / rotated incorrectly. Any ideas? Normal mesh from ARMeshManager renders where it should be when not using classification. When classification is on, it seems to be lower and rotated and offset somehow (floor is below my floor somewhere)

1 Like

Hi @TigrrrLionBear, have you managed to fix this issue? I also got this error while modify the MeshClassificationFracking and run it on the AVP.