Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

SpatialMapping.cs

Hello:

I just upgrade Visual Studio to Update 2...installed Unity for Hololens and everything else that was needed...

I started following Holograms 101E but when I open the Origami project on Unity I get some errors on the SpatialMapping.cs file...

Error CS1061 'SurfaceObserver' does not contain a definition for 'OnSurfaceChanged' and no extension method 'OnSurfaceChanged' accepting a first argument of type 'SurfaceObserver' could be found (are you missing a using directive or an assembly reference?) Origami.CSharp C:\Blag\Hololens\HolographicAcademy-Holograms-101\Origami\Assets\Holograms\Support\Spatial Mapping\SpatialMapping.cs 44 Active

Error CS7036 There is no argument given that corresponds to the required formal parameter 'onSurfaceChanged' of 'SurfaceObserver.Update(SurfaceObserver.SurfaceChangedDelegate)' Origami.CSharp C:\Blag\Hololens\HolographicAcademy-Holograms-101\Origami\Assets\Holograms\Support\Spatial Mapping\SpatialMapping.cs 54 Active

Error CS7036 There is no argument given that corresponds to the required formal parameter 'onDataReady' of 'SurfaceObserver.RequestMeshAsync(SurfaceData, SurfaceObserver.SurfaceDataReadyDelegate)' Origami.CSharp C:\Blag\Hololens\HolographicAcademy-Holograms-101\Origami\Assets\Holograms\Support\Spatial Mapping\SpatialMapping.cs 116 Active

So this doesn't seem like a library or reference problem...but stuff missing on the code itself...does anyone knows how to fix this? Is there any update file?

Greetings,

Blag.

--
Blag.
Developer Evangelist - Development Culture
SAP Labs Silicon Valley.

Best Answers

Answers

  • That makes two of us. Downloaded all the tools this afternoon, installed them and rebooted machine... Started Course 101E - Chapter 1. As soon I add the Origami content... the error in the console comes up.

    One thing I did note... the Origami project code has not been updated since a month ago... When I open Unity Hololens 5.4.0b10-HTP (64-bit) it wants to update the project because it works with older version of Unity... Still the issue seems to lie in the SurfaceObserver class... do not see any OnSurfaceChanged call

    Observer.OnSurfaceChanged += Observer_OnSurfaceChanged; Line 43 in SpatialMapping.cs

  • Saw that...I thought the Github repository might has been updated...but nope...I guess we just need to wait for the Hololens teams to update the files... -:(

    --
    Blag.
    Developer Evangelist - Development Culture
    SAP Labs Silicon Valley.

  • I'm running into the same problem as well.

  • Glad...in a weird way...not to be the only one having this problem :) Let's hope they fix this soon...

    --
    Blag.
    Developer Evangelist - Development Culture
    SAP Labs Silicon Valley.

  • Hi, got the same exact problem. Don't you think we should raise it to the Hololens Team?

  • I thought that is what we were doing here? LOL

  • Same problem here as well

  • I think all of us with this problem... vote up Blag's original post. Thanks!

  • james_ashleyjames_ashley ✭✭✭✭

    I'm sure the HL Team will fix this soon. In the meantime, I'd recommend just skipping ahead. Course 210 - Gaze is awesome. :)

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • LaggerLTDLaggerLTD
    edited March 2016

    I have also ran into this problem when trying to import the Origami file into Unity. This is part of the Holograms 101E tutorial here:

    https://developer.microsoft.com/en-us/windows/holographic/holograms_101e

    A solution that I found was to right click onto the Assets needed in the project window and then export them to a separate file. I did this with all the assets except the Spatial Mapping Asset and the Underworld Asset since these two contained the errors. I then created a new project in Unity and then went to Assets > Import Package and then selected each Asset that I had exported from the 101E tutorial. This allowed me to run the 101E tutorial without getting any compiling errors. Unfortunately, when I got to the second part of the lesson, Gaze, I found that I could render the cursor Asset in Unity, and it will display in the hololens, but I cannot get the cursor to move. I fear this is an issue with the script WorldCursor.cs that is on the above link, but I am not sure. I have tried attaching the script using multiple methods in Unity, and the script attaches properly and compiles, but then the cursor just sits there in front of the origami collection as if no script is attached to it at all. If anyone else would like to try this method please post below and let me know how it works out for you. I am going to try and forge ahead like james_ashley suggested and try the 210 tutorial here:

    https://developer.microsoft.com/en-us/windows/holographic/holograms_210

    I understand we've only had this tech for a day so lets try to figure this out together.

  • I appreciate the quick response Jackson. This code snippet worked perfectly for me. I copied and pasted the new code into the SpatialMapping.cs file and this fixed all the errors I had running the Origami demo. It cleared all the errors in Unity that were in the SpatialMapping file and the Underworld file as well. I can now run through all of the Holograms 101E tutorial.

  • That fixed it for me.. thanks!

  • Thanks a lot Jackson! That's awesome! :smiley: Will test it tomorrow morning :smile:

    --
    Blag.
    Developer Evangelist - Development Culture
    SAP Labs Silicon Valley.

  • Got an error with Nuget...but solve it using this https://forums.hololens.com/discussion/comment/865#Comment_865 Now...Hololens emulator is loading! :smiley:

    --
    Blag.
    Developer Evangelist - Development Culture
    SAP Labs Silicon Valley.

Sign In or Register to comment.