-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sample for Magic Leap integration #66
Conversation
This sample relies on CesiumGS/cesium-unity#429 making it in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azrogers I can't build / run the scene because I'm getting this error:
I commented out the code to try and run it, but then it domino'd into this:
I'm not sure what went wrong during setup, because I just followed the dialog boxes as they came up. Can you help with instructions so I can actually try out the level? 😄
Assets/CesiumForUnitySamples/Scripts/CesiumSamplesRequiresMagicLeap.cs
Outdated
Show resolved
Hide resolved
Assets/CesiumForUnitySamples/Scripts/CesiumSamplesRequiresMagicLeap.cs
Outdated
Show resolved
Hide resolved
Assets/CesiumForUnitySamples/Scripts/CesiumSamplesRequiresMagicLeap.cs
Outdated
Show resolved
Hide resolved
I'm not sure why this is happening. Going through all the instructions on my machine gives no issues. This error should only be happening if the Magic Leap SDK is installed but for some reason the UnityEngine.XR.OpenXR.Features.MagicLeapSupport namespace is unavailable. What version of the SDK did you install? Did you install it from the tarball you got from the ML Hub? |
I had version 1.8.0 installed. I retried it with 2.1.0 and the errors seem to have gone away, thankfully. But I think this means we need to document the minimum version of the SDK required. Still, I tried to do a build and I instantly got these errors: I had to go to Project Settings > XR Plugin Management > Project Validation and click "Fix All", and also manually change the Texture Compression Format to "DXT" under Project Settings > Player. During the second build, I keep being reprompted by the window to automatically configure Build Settings for Magic Leap. But then it won't build because of these weird errors? I'll keep trying to solve this on my end, but do you see these yourself @azrogers if you make a fresh clone of the samples and checkout this branch? |
Definitely need at least version 2.0.0 of the SDK, I'll add that to the checks. Those two validation errors are tricky. The first one, DXT texture compression, isn't accessible in code before Unity 2023, and the ML SDK itself just gives up and opens the settings window for you to fix it yourself: https://github.com/magicleap/MagicLeapUnitySDK/blob/a04dcbf370525b1158e9ff1bcafddd080e4bc33a/Runtime/OpenXR/MagicLeapProjectValidation.cs#L87. The second, about the Oculus Quest Feature, is a weird one since it's detecting the feature being enabled even though it's... not. Apparently some fields in The build errors after you fixed those two issues are just because |
@azrogers I pushed a commit that does the following:
One thing I still want to test: I noticed you made changes to the VR metadata picking script, and I just want to confirm that the script still works for the Quest 2 sample. Will do tomorrow. Let me know if there are any changes you disagree with. |
Unfortunately the changes to the Metadata Picking VR script broke the metadata picking level for the Quest 2. I think the quickest solution at this point is to duplicate the script for Magic Leap, and restore the original VR script. |
@j9liu Thank you for the changes! I've restored the old VR picking script and moved my changes into a new script just for the Magic Leap sample. I've also made changes to the README and added a Getting Started tooltip as requested! |
@azrogers Thanks for the changes, I just made some minor tweaks I didn't want to trouble you with. Unfortunately the one thing keeping me from merging is that the new I'll try to debug tomorrow, but just running it by you in case you see this in a fresh clone of the samples. |
Resolved the aforementioned script error, and fixed the incorrect controller input. Thanks @azrogers ! |
This pull request adds a sample for using Cesium with a Magic Leap 2 headset. It's a sample scene of Manhattan with locations marked for you to pick from, and you can click on each building to see its metadata. I'm filing it into a draft PR for now because there's a few bugs with the demo I still need to fix, but it's nearly there.
One thing to note is the editor scripts - I didn't want to make the whole project depend on the Magic Leap SDK, so I needed to use some editor scripting to add a script define for when the package is included. It will inform the user they need to install the SDK when opening the scene, as well as providing an option to automatically configure recommended build settings for the demo to work.