I recently updated to the latest SDK and OS. The dimmer now has one more parameter to use, which I don't see in the changelog. The issue I'm currently experiencing might be connected but idk. OpenXR seemed to have changed when looking in the project settings. I'm no longer able to set the dimmer inside our app and get a constant barrage of errors.
The following is the error log from ADB:
EntryPointNotFoundException: Unable to find an entry point named 'MLOpenXRSetGlobalDimmerFrameEndInfoParams' in 'MagicLeapXrProvider'. Tried the following entry points: Unable to get function 'MLOpenXRSetGlobalDimmerFrameEndInfoParams' because of 'The requested function was not found (0x06000001) dlerror() = undefined symbol: MLOpenXRSetGlobalDimmerFrameEndInfoParams
Unity Editor version: 2022.3.11
ML2 OS version: Version 1.4.0-dev2
MLSDK version: 1.11.0
Host OS: (Windows)
Hello, sorry about the trouble. Are you using the v1.4.0-dev2 MLSDK to build as well? Note that this is different from the Unity SDK version that would be visible in the Unity package manager. To check what MLSDK you are building against in the Unity editor, open Edit -> Preferences -> External Tools -> Magic Leap. You'll see the MLSDK path there-
If you like, you can import the MagicLeap setup tool into your project to quickly check your project configuration-
I tried quickly testing the global dimmer Unity api in a simple project and it worked with OS 1.4-d2, MLSDK 1.4-d2, Unity sdk 1.11.0, Unity 2022.3.10f1, so almost the same configuration.
Here's a monobehavior script that you can attach to a gameobject to test the dimmer-
public class DimmerTest : MonoBehaviour
public float period = 2.0f;
float t = (Time.timeSinceLevelLoad % period) / period;
MLGlobalDimmer.SetValue(-0.5f * Mathf.Cos(2.0f * Mathf.PI * t) + 0.5f);
By the way, just for sanity, currently I would only expect Android builds in Unity to work on MagicLeap with the MagicLeap XR provider. You would likely have issues if you attempted to deploy an Android build using the OpenXR provider. Please let us know if you continue to have issues.
Yes, the MLSDK matches.
Also, I believe I'm using the MagicLeapXR provider unless this isnt what you were talking about.
The code that you sent shouldn't've compiled unless you are using an older version of OpenXR since there is another parameter added in one the of the recent updates.
Currently I'm using the latest OpenXR package: 1.8.2... So I'm wondering what version I should be using?
I just removed the OpenXR package all together and that seemed to have fixed the issue. I don't recall why it was in the project in the first place but that was the culprit. However in the magic leap code you seem to be accounting for it, so id look into that.