Skip to content
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

NRE on OpenXRLeapProvider when Initialize XR on Startup is disabled #1360

Closed
bdovaz opened this issue Dec 13, 2022 · 5 comments
Closed

NRE on OpenXRLeapProvider when Initialize XR on Startup is disabled #1360

bdovaz opened this issue Dec 13, 2022 · 5 comments
Assignees
Labels

Comments

@bdovaz
Copy link

bdovaz commented Dec 13, 2022

In our project we decide in execution if we activate or not XR depending on some parameters.

This makes that from the beginning this option is not checked and that is why we have realized that there is a use case that is not handled as far as I can see.

In this while loop it seems that it checks that neither "XRGeneralSettings.Instance" nor "XRGeneralSettings.Instance.Manager" nor "XRGeneralSettings.Instance.Manager.activeLoader" is null:

https://github.com/ultraleap/UnityPlugin/blob/com.ultraleap.tracking/6.3.0/Packages/Tracking/Core/Runtime/Scripts/XRLeapProviderManager.cs#L98

But shouldn't the operator be || (OR)? As it is it would just check that "XRGeneralSettings.Instance" is not null and exit while loop.

By having that check incorrectly, it causes this script to fail with an NRE on the next line:

https://github.com/ultraleap/UnityPlugin/blob/com.ultraleap.tracking/6.3.0/Packages/Tracking/OpenXR/Runtime/Scripts/OpenXRLeapProvider.cs#L63

@MattGrayUL
Copy link
Contributor

Hi @bdovaz,

Thanks for raising this, you are right and this is an oversight on my part!

I will raise a ticket for it and hope to address it in a release ASAP

@MattGrayUL MattGrayUL added the bug label Dec 13, 2022
@MattGrayUL MattGrayUL self-assigned this Dec 13, 2022
@MattGrayUL
Copy link
Contributor

As an extra, we have internally discussed the idea of adding the ability to re-initialize the XRLeapProviderManager at runtime (or even edit the specified tracking source), it sounds like this would be relevant to your use case

To help us guide that conversation and any resulting implementation, Can I ask what your application is doing for it to swap between XR and non-XR and whether this would be a useful feature?

@bdovaz
Copy link
Author

bdovaz commented Dec 13, 2022

Per NDA I can't comment much but it is a development that can be run with or without XR. That is:

  1. with HMD + Ultraleap.
  2. With keyboard and mouse.

In runtime a parameter is read by command line which is what is used to decide one thing or the other.

The use of Ultraleap is not required so when we are in keyboard and mouse mode we "simulate hands" and you can touch and pick up objects in a more simplified way.

@MattGrayUL
Copy link
Contributor

MattGrayUL commented Dec 14, 2022

Thanks, that's helpful information :)

Also, as a stop-gap until a release includes the fix, you should be able to have the XRLeapProviderManager disabled by default, and enable it if you do enter XR mode?

That would kick the While loop off when you know it will not fail :)

@MattGrayUL
Copy link
Contributor

This has been addressed in 6.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants