Showing results for 
Search instead for 
Did you mean: 

Loading state to ScenePerception module

Hi folks,

Trying to extend the sample application for Scene Perception in Unity with a feature to save and load state of the ScenePerception module. I can successfully save state using SaveCurrentState(), but when I try to load the state in the next session the function reports success but it doesn't seem to do anything.

What are the prerequisites for loading state? I have set up a SenseManager instance and call LoadState before i do Init(). Do I need to do anything else to load the mesh into Unity before I can start meshing in DepthFusion?

Tried to read up in the SDK documentation but it was quite terse on the subject. Any pointers much appreciated!



0 Kudos
1 Reply


So I figured this out. Turns out I need to call LoadState before Init but after QueryScenePerception and EnableScenePerception.

Now, I can save and load the state of the ScenePerception module, but some interesting things pop up.

  1. The maximum number of block meshes that can be loaded is 16384, roughly equivalent to a space of 2x2x2m, even though I was able to capture a mesh that was considerably larger than that (6x8x2m).
  2. The save file is larger for scenes that have more information than 2x2x2m, suggesting that some data is in fact saved.
  3. While the meshing/reconstruction does not seem to be able to recover state from large scenes, the tracking clearly does! For instance, it can correctly track position in spaces that were meshed in a previous session.

Is there a way to overcome this limitation of 16384 block meshes, for instance by requesting block meshes in chunks by setting one 2x2x2m area at a time with SetMeshingRegion?