Dynamically change PixelSensor settings

Hello everyone,

I am working on a project using PixelSensor API. My goal is to get the access to the World Center sensor, get frames, and eventually change back settings of the PixelSensor without restarting it.

I started from the code proposed on the doc : World Camera Example | MagicLeap Developer Documentation , currently I have successfully acces of the camera, the current frame and I can change the settings of PixelSensor at the start (during the configuration).

Now I want to adapt exposure settings in real time, especially Target Brightness from AutoExposure Mode. At each frame captured I get from an extern method a value that indicates “do nothing/ increase Target Brightness/ decrease Target Brightness”, but I don’t know :

  • if it’s possible to update the setting’s value (or any other one) without restarting the camera / the streams
  • where to do it in the script/pipeline,
  • how to update the value properly

I supposed I could just create a method that retake the same lines as it is used to set the value at the starting configuration, then call this method in the Update(), but it didn’t work even though the application don’t crash. I’ve already checked that :

  • I can receive the different indication “do nothing/ increase Target Brightness/ decrease Target Brightness”;
  • the private value “AutoExposureTargetBrightness” in the script is well updated as I wanted;
  • the loop inside Update is running without problem (I put a debug lof before and after the logic block concerning the setting’s value update).

Can anyone help me?

Unity Editor version: 6000.3.0f1
ML2 OS version: 1.12.0
Host OS: (Windows/MacOS) Windows11