Clear Meshes in ARDK 3.0

  • Issue category: Meshing
  • ARDK version: 3.0

Hi,

I would like to know how to delete the meshes generated by the ARMeshManager so that I can start from scratch with new ones. I am talking about some method equivalent to ClearMeshObjects() in ARDK 2.5.2. So far I have tried the following:

_arMeshManager.DestroyAllMeshes();
_arfSession.Reset();

DestroyAllMeshes() deletes the existing meshes, but they show up again with the same size and shape if the ARMeshManager is still enabled. Even if I reset the ARSession inmediately after destroying the meshes, new Trackables are automatically created with the same old meshes.

I have also tried deleting the ARMeshManager and creating a new one, but the old meshes still show up, I guess because they are not stored in the manager but in the meshing subsystem. So I tried destroying the subsystem, but after that I don’t know how to restart it again. ARMeshManager.subsystem.Start() doesn’t work for that.

The only thing that allows me to completely reset the meshing subsystem is to reload the scene, but this solution does not fit into the workflow of my application.

I asked this question on the Unity forums and got an answer that might be appropriate for iOS phones, since meshing in AR Foundation is only available on them, but not on Android. But I am working with Android.

Thanks in advance

Yes that’s a known limitation of the current Beta. We are going to look into this.

Ok, thank you @Guy-Richard_Kayombya

After updating to ARDK3.0-Beta2 and ArCore Unity Extensions 1.38, I gave it another try and now it seems that this simple code restarts the meshes:

  _arMeshManager.enabled = false;
  _arMeshManager.DestroyAllMeshes();
  _arMeshManager.enabled = true;

I think I tried this before the updates, so I don’t know what exactly has changed. Anyway, I leave it here in case it helps anyone.

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.