Skip to content

NullReferenceExpection in BaseSpatialObserver.CleanupMeshObject on Hololens #3226

@wassx

Description

@wassx

Does this affect the legacy HoloToolkit (master) or the Mixed Reality Toolkit (mrtk_release)?
Mixed Reality Toolkit

Describe the bug
We added the spatial awareness system to visualize the room mesh. It works as expected on the hololens, but in the log I receive lots of NullReferenceExceptions in a very short timespan (see screenshot).

image

To Reproduce
The setup of the configuration profile looks like this:
image

So it is initially active and will be set programatically to hidden by using following code, but as far as I found out this switch is not relevant as the error occurs on the InvokeSurfaceDataReadyEvent (see stacktrace):

private void SetSpatialMeshPulseVisible(bool visible) {
    bool isOpaque = MixedRealityToolkit.Instance.ActiveProfile.CameraProfile.IsOpaque;
    SpatialMeshDisplayOptions displayOptions = visible && !isOpaque ? SpatialMeshDisplayOptions.Visible : SpatialMeshDisplayOptions.None;
    MixedRealityToolkit.Instance.GetService<IMixedRealitySpatialAwarenessSystem>().MeshDisplayOption =
            displayOptions;
}

Unity Editor Version
2018.2.17f1

Mixed Reality Toolkit Release Version
mrtk_development 49f5c4c

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions