Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bsawyer-ml committed Jan 17, 2024
1 parent 19631f4 commit 937ce95
Show file tree
Hide file tree
Showing 90 changed files with 1,100 additions and 769,751 deletions.
36 changes: 31 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
# Changelog

## [1.12.1]
## [2.0.0]

### Features
- Replace the Magic Leap XR Plugin with the OpenXR Plugin as the direct XR provider dependency package. If you'd wish to continue using the Magic Leap XR Plugin, install it from the Package Manager, and ensure it is enabled as the sole XR provider in Project Settings/XR Plug-in Management.
- Added `Magic Leap 2 Support` OpenXR Feature
- Added `Magic Leap 2 Localization Maps` OpenXR Feature
- Added `Magic Leap 2 Marker Understanding` OpenXR Feature
- Added `Magic Leap 2 Plane Detection` OpenXR Feature
- Added `Magic Leap 2 Reference Spaces` OpenXR Feature
- Added `Magic Leap 2 Rendering Extensions` OpenXR Feature
- Added `Magic Leap 2 System Notification Control` OpenXR Feature
- Added `Magic Leap 2 User Calibration` OpenXR Feature
- Added `Magic Leap 2 Controller Interaction Profile` for OpenXR
- Added `ML Rig & Inputs` Sample
- Changed `MLMarkerTracker` default settings behavior to not begin marker tracking immediately. Also set the default MarkerType to None when creating the `MLMarkerTracker.TrackerSettings` struct.

### Experimental
- Added `Magic Leap 2 Spatial Anchors` and `Magic Leap 2 Spatial Anchors Storage` OpenXR Features

### Bugfixes
- Fixed an issue in `MLGestureClassification` where hand transform and interaction points would freeze in place when Posture type was None.
- Added missing comments describing parameters and returns to functions in `MLSpace`.
- Fixed issue in `MLMediaPlayerBehavior` where HLS streams would not play after resolution changes.
- Fixed issue in `MLMediaPlayerBehavior` where DASH streams would not display video or audio.
- Fixed issue in `MLCamera` that resulted in crashes & artifacts when rendering YUV capture to a RenderTexture.
- Fixed issue in `MLCamera` that resulted in crashes when waking from sleep.
- Fixed issue with legacy Hands subsystem causing compilation errors in MRTK projects.
- Fixed issue with Segmented Dimmer not functioning correctly
- Improved performance of `MLEyeCamera`
- Fixed issue with MagicLeapCamera.cs performing expensive JNI operations every frame leading to an eventual crash in some apps.

### Deprecations & Removals
- `MLCamera`: Deprecated `MLCamera` API. Developers will need to utilize the Android SDK Camera2 API or the NDK Camera API instead.

## [1.12.0]

Expand All @@ -16,11 +45,8 @@
### Bugfixes
- Fixed an issue where Vulkan would fail to initialize if Unity's WebRTC package (`com.unity.webrtc`) is installed in the project.
- Fixed issue where MLMediaPlayerBehavior wasn't outputting warning logs
- Fixed an issue in `MLGestureClassification` where hand transform and interaction points would freeze in place when Posture type was None.
- Added missing comments describing parameters and returns to functions in `MLSpace`

### Deprecations & Removals
- `MLCamera`: Deprecated `MLCamera` API. Developers will need to utilize the Android SDK Camera2 API or the NDK Camera API instead.
- `MLMediaPlayer`: Deprecated `MLMedia` API and `MLMediaPlayerBehavior`. Developers needing to play video files are encouraged to upgrade their project to Unity 2022.3.10 and use the [VideoPlayer component](https://docs.unity3d.com/Manual/class-VideoPlayer.html).

## [1.11.0]
Expand Down Expand Up @@ -53,7 +79,7 @@
- `CameraCaptureExample`: Fixed `NullReferenceException` when pausing example scene.

### Deprecations & Removals
- `MLWebRTC`: Deprecated `MLWebRTC`
- `MLWebRTC`: Deprecated `MLWebRTC`

### Known Issues

Expand Down
2 changes: 2 additions & 0 deletions Editor/APKBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ private void BuildAllScenes()
{
List<string> activeScenes = new List<string>();
EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes;
int index = 0;
foreach (EditorBuildSettingsScene scene in scenes)
{
if(string.IsNullOrEmpty(scene.path) || scene == null)
Expand All @@ -146,6 +147,7 @@ private void BuildAllScenes()
continue;
}
activeScenes.Add(scene.path);
index++;
}

string apkName = PlayerSettings.applicationIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion Editor/BuildPreprocessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void SetLinearColorSpace()
if (editorProjectData.EnableColorSpaceWarning)
{
int option = EditorUtility.DisplayDialogComplex("Invalid Color Space",
"PlayerSettings.colorSpace is set to Gamma for Relish which is not recommended for that platform.",
"PlayerSettings.colorSpace is set to Gamma which is not recommended for Magic Leap 2.",
"Switch to Linear Space",
"Ignore and continue always",
"Ignore and continue"
Expand Down
5 changes: 5 additions & 0 deletions Editor/Inspectors/MagicLeapCameraEditor.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using System.Linq;
using UnityEditor.XR.Management;
using UnityEngine;
using UnityEngine.XR.OpenXR;
using MagicLeapCamera = UnityEngine.XR.MagicLeap.MagicLeapCamera;

namespace UnityEditor.XR.MagicLeap
{
#pragma warning disable CS0618 // Type or member is obsolete
[CustomEditor(typeof(MagicLeapCamera))]
#pragma warning restore CS0618 // Type or member is obsolete
class MagicLeapCameraEditor : Editor
{
private static GUIContent stereoConvergencePointText = new GUIContent("Stereo Convergence Point", "Transform you want to be the focus point of the camera");
Expand Down
16 changes: 12 additions & 4 deletions Editor/OpenXR/AndroidBootConfig.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2023 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
using System;
using System.Collections;
using System.Collections.Generic;
Expand All @@ -9,11 +18,10 @@ namespace UnityEditor.XR.OpenXR.Features.MagicLeapSupport
{
internal class AndroidBootConfig
{
private static readonly string kXrBootSettingsKey = "xr-boot-settings";
private static readonly string xrBootSettingsKey = "xr-boot-settings";
Dictionary<string, string> bootConfigSettings;

private BuildReport buildReport;
private string bootConfigPath;

public AndroidBootConfig(BuildReport report)
{
Expand Down Expand Up @@ -58,15 +66,15 @@ public void WriteBootConfig()
}

string buildTargetName = BuildPipeline.GetBuildTargetName(buildReport.summary.platform);
EditorUserBuildSettings.SetPlatformSettings(buildTargetName, kXrBootSettingsKey, sb.ToString());
EditorUserBuildSettings.SetPlatformSettings(buildTargetName, xrBootSettingsKey, sb.ToString());
}

private void ReadBootConfg()
{
bootConfigSettings = new Dictionary<string, string>();

string buildTargetName = BuildPipeline.GetBuildTargetName(buildReport.summary.platform);
string xrBootSettings = EditorUserBuildSettings.GetPlatformSettings(buildTargetName, kXrBootSettingsKey);
string xrBootSettings = EditorUserBuildSettings.GetPlatformSettings(buildTargetName, xrBootSettingsKey);
if (!String.IsNullOrEmpty(xrBootSettings))
{
// boot settings string format
Expand Down
24 changes: 20 additions & 4 deletions Editor/OpenXR/MagicLeapFeatureGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,27 @@ namespace UnityEngine.XR.OpenXR.Features.MagicLeapSupport
FeatureSetId = "com.magicleap.openxr.featuregroup",
SupportedBuildTargets = new [] { BuildTargetGroup.Android, BuildTargetGroup.Standalone },
FeatureIds = new [] {
MagicLeapFeature.featureId ,
MagicLeapRenderingExtensionsFeature.featureId,
MagicLeapReferenceSpacesFeature.featureId,
MagicLeapFeature.FeatureId ,
MagicLeapRenderingExtensionsFeature.FeatureId,
MagicLeapReferenceSpacesFeature.FeatureId,
MagicLeapPlanesFeature.FeatureId,
MagicLeapUserCalibrationFeature.featureId,
MagicLeapUserCalibrationFeature.FeatureId,
MagicLeapSystemNotificationsFeature.FeatureId,
MagicLeapMarkerUnderstandingFeature.FeatureId,
MagicLeapLocalizationMapFeature.FeatureId,
MagicLeapSpatialAnchorsFeature.FeatureId
},
RequiredFeatureIds = new[] {
MagicLeapFeature.FeatureId
},
DefaultFeatureIds = new[] {
MagicLeapRenderingExtensionsFeature.FeatureId,
MagicLeapReferenceSpacesFeature.FeatureId,
MagicLeapPlanesFeature.FeatureId,
MagicLeapUserCalibrationFeature.FeatureId,
MagicLeapSystemNotificationsFeature.FeatureId,
MagicLeapMarkerUnderstandingFeature.FeatureId,
MagicLeapLocalizationMapFeature.FeatureId
}
)]
public class MagicLeapFeatureGroup
Expand Down
84 changes: 38 additions & 46 deletions Editor/OpenXR/OpenXRBuildProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2023 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
#if UNITY_OPENXR_1_9_0_OR_NEWER
using System;
using System.IO;
using System.Linq;
using System.Xml;
using UnityEditor.Build.Reporting;
using UnityEditor.XR.MagicLeap;

#if UNITY_OPENXR_1_9_0_OR_NEWER
using UnityEditor.XR.Management;
using UnityEngine.XR.OpenXR;
using UnityEngine.XR.OpenXR.Features.MagicLeapSupport;

namespace UnityEditor.XR.OpenXR.Features.MagicLeapSupport
Expand All @@ -15,77 +26,52 @@ internal class OpenXRBuildProcessor : OpenXRFeatureBuildHooks

public override Type featureType => typeof(MagicLeapFeature);

private static readonly string kHaveAndroidWindowSupportBootSettingsKey = "android-device-have-window-support";
private static readonly string kUseNullDisplayManagerBootSettingsKey = "android-device-use-null-display-manager";
private static readonly string kAndroidAudioUseMLAudio = "android-audio-use-MLAudio";
private static readonly string kVulkanForceDisableETCSupport = "vulkan-force-disable-ETC-support";
private static readonly string kVulkanForceDisableASTCSupport = "vulkan-force-disable-ASTC-support";
private static readonly string kVulkanDisablePreTransform = "vulkan-disable-pre-transform";
private static readonly string haveAndroidWindowSupportBootSettingsKey = "android-device-have-window-support";
private static readonly string useNullDisplayManagerBootSettingsKey = "android-device-use-null-display-manager";
private static readonly string vulkanForceDisableETCSupport = "vulkan-force-disable-ETC-support";
private static readonly string vulkanForceDisableASTCSupport = "vulkan-force-disable-ASTC-support";
private static readonly string vulkanDisablePreTransform = "vulkan-disable-pre-transform";

protected override void OnPreprocessBuildExt(BuildReport report)
{
AndroidBootConfig bootConfig = new AndroidBootConfig(report);

if (report.summary.platform == BuildTarget.Android)
{
bootConfig.SetValueForKey(kHaveAndroidWindowSupportBootSettingsKey, "1", true);
bootConfig.SetValueForKey(kUseNullDisplayManagerBootSettingsKey, "0", true);
bootConfig.SetValueForKey(kVulkanForceDisableETCSupport, "1", true);
bootConfig.SetValueForKey(kVulkanForceDisableASTCSupport, "1", true);
bootConfig.SetValueForKey(kVulkanDisablePreTransform, "1", true);
MagicLeapFeature magicLeapFeature = FeatureHelpers.GetFeatureWithIdForBuildTarget(BuildTargetGroup.Android, MagicLeapFeature.featureId) as MagicLeapFeature;
if (magicLeapFeature != null)
{
bootConfig.SetValueForKey(kAndroidAudioUseMLAudio, magicLeapFeature.IsMLAudioEnabled ? "1" : "0" , true);
}
else
{
bootConfig.SetValueForKey(kAndroidAudioUseMLAudio, "0", true);
}
bootConfig.SetValueForKey(haveAndroidWindowSupportBootSettingsKey, "1", true);
bootConfig.SetValueForKey(useNullDisplayManagerBootSettingsKey, "0", true);
bootConfig.SetValueForKey(vulkanForceDisableETCSupport, "1", true);
bootConfig.SetValueForKey(vulkanForceDisableASTCSupport, "1", true);
bootConfig.SetValueForKey(vulkanDisablePreTransform, "1", true);
}
else
{
bootConfig.ClearEntryForKey(kHaveAndroidWindowSupportBootSettingsKey);
bootConfig.ClearEntryForKey(kUseNullDisplayManagerBootSettingsKey);
bootConfig.ClearEntryForKey(kVulkanForceDisableETCSupport);
bootConfig.ClearEntryForKey(kVulkanForceDisableASTCSupport);
bootConfig.ClearEntryForKey(kVulkanDisablePreTransform);
bootConfig.ClearEntryForKey(kAndroidAudioUseMLAudio);
bootConfig.ClearEntryForKey(haveAndroidWindowSupportBootSettingsKey);
bootConfig.ClearEntryForKey(useNullDisplayManagerBootSettingsKey);
bootConfig.ClearEntryForKey(vulkanForceDisableETCSupport);
bootConfig.ClearEntryForKey(vulkanForceDisableASTCSupport);
bootConfig.ClearEntryForKey(vulkanDisablePreTransform);
}

bootConfig.WriteBootConfig();
}

protected override void OnPostGenerateGradleAndroidProjectExt(string path)
{
// don't bother if the OpenXR loader isn't actually enabled for the build
if (!IsOpenXRLoaderEnabled())
return;

string manifestPath = Path.Combine(path, "src", "main", "AndroidManifest.xml");
AndroidManifestXml manifest = new AndroidManifestXml(manifestPath);

manifest.AddPermission("org.khronos.openxr.permission.OPENXR");
manifest.AddPermission("org.khronos.openxr.permission.OPENXR_SYSTEM");
AddOpenXRRuntimeBrokerInfo(manifest);
AddOpenXRImmersiveHmdIntent(manifest);
manifest.Save();
}

protected override void OnPostprocessBuildExt(BuildReport report) { }

private void AddOpenXRRuntimeBrokerInfo(AndroidManifestXml manifest)
{
const string queryElem = "queries";
const string providerElem = "provider";
const string providerAttrib = "org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker";

// Get all child nodes that match the tag and see if value already exists
XmlNode queriesNode = manifest.ManifestElement.SelectSingleNode(queryElem);
if (queriesNode == null)
{
queriesNode = manifest.ManifestElement.AppendChild(manifest.CreateElement(queryElem));
}

manifest.UpdateOrCreateAttribute(queriesNode as XmlElement, providerElem, "authorities", providerAttrib);
}

private void AddOpenXRImmersiveHmdIntent(AndroidManifestXml manifest)
{
XmlElement activityIntentFilterElement = manifest.SelectSingleNode("/manifest/application/activity/intent-filter") as XmlElement;
Expand All @@ -94,6 +80,12 @@ private void AddOpenXRImmersiveHmdIntent(AndroidManifestXml manifest)
"name",
"org.khronos.openxr.intent.category.IMMERSIVE_HMD");
}

private bool IsOpenXRLoaderEnabled()
{
var settings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(BuildTargetGroup.Android);
return settings.Manager.activeLoaders.Any(l => l is OpenXRLoader);
}
}
}
#endif
36 changes: 0 additions & 36 deletions Editor/OpenXR/SegmentedDimmerMenuItem.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Editor/OpenXR/SegmentedDimmerMenuItem.cs.meta

This file was deleted.

Binary file modified Plugins/Android/libMLAudioOutput.so
Binary file not shown.
Binary file modified Plugins/Android/libMagicLeapXrProvider.so
Binary file not shown.
Binary file modified Plugins/Android/libml_c_utils.so
Binary file not shown.
Binary file modified Plugins/Android/libml_sdk_loader.so
Binary file not shown.
Binary file modified Plugins/Android/libml_unity_native_logging.so
Binary file not shown.
Binary file modified Plugins/Android/libml_ycbcr_renderer.so
Binary file not shown.
Binary file modified Plugins/MacEditor/libMagicLeapXrProvider.dylib
Binary file not shown.
Binary file modified Plugins/MacEditor/libml_sdk_loader.dylib
Binary file not shown.
Binary file modified Plugins/MacEditor/libml_sdk_tests_provider.dylib
Binary file not shown.
Binary file modified Plugins/MacEditor/libml_unity_native_logging.dylib
Binary file not shown.
Binary file modified Plugins/WindowsEditor/MLAudioOutput.dll
Binary file not shown.
Binary file modified Plugins/WindowsEditor/MagicLeapXrProvider.dll
Binary file not shown.
Binary file modified Plugins/WindowsEditor/ml_sdk_loader.dll
Binary file not shown.
Binary file modified Plugins/WindowsEditor/ml_sdk_tests_provider.dll
Binary file not shown.
Binary file modified Plugins/WindowsEditor/ml_unity_native_logging.dll
Binary file not shown.
Loading

0 comments on commit 937ce95

Please sign in to comment.