Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Can't toggle drawVisualMeshes effect.

In an object collection, I register the click function to toggle the drawVisualMesh. But the mesh won't change but keep the initial mode.
I and checked the SpatialMapping.Instance.drawVisualMeshes in debug mode and it did change. But nothing happen to the visual view.
Can anyone help?

The code is as follows ( only the key part):

public class GazeGestureManager : MonoBehaviour
{
void Awake()
{
Instance = this;

    // Set up a GestureRecognizer to detect Select gestures.
    recognizer = new GestureRecognizer();
    recognizer.TappedEvent += (source, tapCount, ray) =>
    {

        var camRotate = Camera.main.transform.rotation;
        bool meshOn = SpatialMapping.Instance.drawVisualMeshes;
        SpatialMapping.Instance.drawVisualMeshes = !meshOn; // toggle the mesh.

        this.BroadcastMessage("OnReset");   // send message to children.
       // OnReset();
    };
    recognizer.StartCapturingGestures();
}

}

Best Answer

Answers

  • @ACstudent

    One debug technique you might try (if you haven't already), is to put a debug.log statement right before your toggle line to check how many times that line of code is getting hit for a given tap event.

    The behavior you describe can happen if the toggle gets flipped multiple times from one interaction. For example, if you happen to reference multiple instances of your GazeGestureManager (which should be a singleton).

    The other important thing that you want to look carefully at is your OnReset code to see if something in that message handler can have any effect on drawVisualMeshes variable.

    Just curious, what is the story with orphan line: var camRotate in your tap event handler?

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • @HoloSheep said:
    @ACstudent

    One debug technique you might try (if you haven't already), is to put a debug.log statement right before your toggle line to check how many times that line of code is getting hit for a given tap event.

    The behavior you describe can happen if the toggle gets flipped multiple times from one interaction. For example, if you happen to reference multiple instances of your GazeGestureManager (which should be a singleton).

    The other important thing that you want to look carefully at is your OnReset code to see if something in that message handler can have any effect on drawVisualMeshes variable.

    Just curious, what is the story with orphan line: var camRotate in your tap event handler?

    Sorry for the late reply. Because our device has been stolen.

  • Thank you.
    How to make such announcement to draw attention?
    Give it as a normal post like this one?

Sign In or Register to comment.