Skip to content

Commit

Permalink
Release V1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kgrinberg-ml committed Sep 6, 2023
1 parent f552f81 commit adce288
Show file tree
Hide file tree
Showing 174 changed files with 7,641 additions and 644 deletions.
29 changes: 24 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
# Changelog

## [1.9.0]
## [1.10.0]

### Features
- `MLDepthCamera`: Added support for switching to Short Range streaming mode and to change FPS and exposure values.
- Added `MLOcclusion` API.
- Added public properties `MagicLeapCamera.EnforceFarClip` and `MagicLeapCamera.RecenterXROriginAtStart`

### Bugfixes
- `MLWebRTC`: Fixed camera disconnection when using `MLNativeSurface` based buffers for rendering.
- Fixed `MLWorldCamera` error on application quit.
- `MLSegmentedDimmer`: Fixed crash when playing scene twice in editor.

- `MLMediaPlayerBehavior`: Fixed unresponsive UI after pressing stop button in `MediaPlayer` example.
- Added missing dropdown for short-range depth camera in `DepthCamera` example.
- `MLCamera`: Fixed error on sleep mode and doze mode.
- `MLCameraBase`: Fixed failure to render preview capture more than once.
- `MLNativeSurface`: Fixed AccessRenderBufferTexture() rendering failure when reusing same player.
- `MLMediaPlayer`: Fixed erroneuous error logging on pending result from Streaming Assets path prepare.
- Fixed `MLMeshing` on map reset.
- `MLMeshing`: Fixed Null Reference Exception on `Meshing` example scene start up.
- Fixed second disconnect attempt in `WebRTC` example.
- `HandTrackingExample`: Fixed `PoseNotFound` errors that might occur after `HandTracking` scene changes.
- `MLGestureClassification`: Fixed errors thrown when hands not detected.
- `MLUnityNativeLogging`: Conditionally reduced log level of snapshot errors based on build configuration.
- `GraphicsHook`: Added cleanup logic that resets the snapshot prediction state of the input subsystem
### Deprecations & Removals

### Known Issues

## [1.9.0]

### Features
- `MLDepthCamera`: Added support for switching to Short Range streaming mode and to change FPS and exposure values.

### Bugfixes
- `MLWebRTC`: Fixed camera disconnection when using `MLNativeSurface` based buffers for rendering.
- Fixed `MLWorldCamera` error on application quit.

## [1.8.0]
### Features
Expand Down
12 changes: 6 additions & 6 deletions Editor/MLAppSim/AppSimShimLibSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class AppSimShimLibSupport
{
private static string LaunchProcess => Path.Combine(MagicLeapSDKUtil.AppSimRuntimePath, "bin/ZIDiscovery");

private static readonly string SessionStateKey = "ZI_SEARCH_PATHS";
public static readonly string SessionStateKey_ZISearchPaths = "ZI_SEARCH_PATHS";
private static List<string> libSearchPaths = new List<string>();

/// <summary>
Expand Down Expand Up @@ -56,20 +56,20 @@ private static void CheckForLibrarySearchPaths()
return;
}

string cachedSearchPaths = SessionState.GetString(SessionStateKey, string.Empty);
string cachedSearchPaths = SessionState.GetString(SessionStateKey_ZISearchPaths, string.Empty);
if (string.IsNullOrEmpty(cachedSearchPaths))
{
var ziRuntime = MagicLeapSDKUtil.AppSimRuntimePath;
#if UNITY_EDITOR_WIN
ziRuntime = ziRuntime.Replace("/", "\\");
#endif
if (string.IsNullOrEmpty(ziRuntime))
{
Debug.LogError("Zero Iteration Runtime path is not set.");
SettingsService.OpenUserPreferences("Preferences/External Tools/Magic Leap");
return;
}

#if UNITY_EDITOR_WIN
ziRuntime = ziRuntime.Replace("/", "\\");
#endif
var startInfo = new System.Diagnostics.ProcessStartInfo
{
UseShellExecute = false,
Expand Down Expand Up @@ -101,7 +101,7 @@ private static void CheckForLibrarySearchPaths()
}

libSearchPaths = new List<string>(output.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries));
SessionState.SetString(SessionStateKey, string.Join(Path.PathSeparator, libSearchPaths));
SessionState.SetString(SessionStateKey_ZISearchPaths, string.Join(Path.PathSeparator, libSearchPaths));
}
else
{
Expand Down
36 changes: 20 additions & 16 deletions Editor/MagicLeapSDKUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,7 @@ public sealed class MagicLeapSDKUtil
#else
private const UnityEditor.BuildTarget kBuildTarget = BuildTarget.Relish;
#endif
private static readonly uint minApiLevel = 0;

static MagicLeapSDKUtil()
{
try
{
var result = UnityEngine.XR.MagicLeap.Native.MagicLeapNativeBindings.MLUnitySdkGetMinApiLevel(out minApiLevel);
UnityEngine.XR.MagicLeap.MLResult.DidNativeCallSucceed(result, nameof(UnityEngine.XR.MagicLeap.Native.MagicLeapNativeBindings.MLUnitySdkGetMinApiLevel));
}
catch(DllNotFoundException)
{
Debug.LogWarning($"Unable to look up minimum Magic Leap API level for editor scripting as the ml_sdk_loader has not been built for host.\n" +
$"\tDeveloper: Run \"build.py -h\" to rebuild NativeLibs including for host OS to access this value.");
}
}
private static uint minApiLevel = 0;

[Serializable]
private class SDKManifest
Expand All @@ -62,7 +48,25 @@ public static bool SdkAvailable
}
}

public static uint MinimumApiLevel => minApiLevel;
public static uint MinimumApiLevel
{
get
{
if(minApiLevel == 0)
{
try
{
var result = UnityEngine.XR.MagicLeap.Native.MagicLeapNativeBindings.MLUnitySdkGetMinApiLevel(out minApiLevel);
UnityEngine.XR.MagicLeap.MLResult.DidNativeCallSucceed(result, nameof(UnityEngine.XR.MagicLeap.Native.MagicLeapNativeBindings.MLUnitySdkGetMinApiLevel));
}
catch(DllNotFoundException)
{
Debug.LogWarning($"Native plugins have not been built for host ({Application.platform}). Minimum API level can't be queried.");
}
}
return minApiLevel;
}
}

/// <summary>
/// MLSDK path for the relish target.
Expand Down
34 changes: 34 additions & 0 deletions Editor/OpenXR/MagicLeapFeatureGroup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2019-2022) 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_7_0_OR_NEWER
using UnityEditor;
using UnityEditor.XR.OpenXR.Features;

namespace UnityEngine.XR.OpenXR.Features.MagicLeapSupport
{
[OpenXRFeatureSet(
UiName = "Magic Leap",
Description = "All Magic Leap OpenXR Features",
FeatureSetId = "com.magicleap.openxr.featuregroup",
SupportedBuildTargets = new [] { BuildTargetGroup.Android, BuildTargetGroup.Standalone },
FeatureIds = new [] {
MagicLeapFeature.featureId ,
MagicLeapHandTrackingFeature.featureId,
MagicLeapRenderingExtensionsFeature.featureId,
MagicLeapReferenceSpacesFeature.featureId,
MagicLeapClippingPlaneEnforcementFeature.featureId,
MagicLeapPlanesFeature.FeatureId,
}
)]
public class MagicLeapFeatureGroup
{ }
}
#endif
11 changes: 11 additions & 0 deletions Editor/OpenXR/MagicLeapFeatureGroup.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Editor/OpenXR/SegmentedDimmerMenuItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2019-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_7_0_OR_NEWER
using UnityEngine;
using UnityEngine.XR.OpenXR.Features.MagicLeapSupport;

namespace UnityEditor.XR.OpenXR.Features.MagicLeapSupport
{
public static class SegmentedDimmerMenuItem
{
[MenuItem("GameObject/XR/Magic Leap Segmented Dimmer")]
public static void AddSegmentedDimmerToScene()
{
var mainCamera = Camera.main;
if (mainCamera == null)
{
Debug.LogError($"Could not find Main Camera! Before adding a Segmented Dimmer to your scene, you must add a Camera and tag it \"MainCamera\"");
return;
}

var prefab = AssetDatabase.LoadAssetAtPath<DimmerCameraControl>("Packages/com.magicleap.unitysdk/Runtime/Tools/Prefabs/Segmented Dimmer.prefab");
var instance = GameObject.Instantiate(prefab.gameObject, mainCamera.transform);
instance.name = "Segmented Dimmer";
Selection.objects = new Object[] { instance };
}
}
}
#endif
11 changes: 11 additions & 0 deletions Editor/OpenXR/SegmentedDimmerMenuItem.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static PreferencesLoader()
{
if (!string.IsNullOrEmpty(labdriverResultPath))
{
SessionState.SetString(LabdriverFoundBackendPath, labdriverResultPath);
EditorPrefs.SetString(LabdriverFoundBackendPath, labdriverResultPath);
if (ziRuntimePath != labdriverResultPath)
{
ziRuntimePath = labdriverResultPath;
Expand Down Expand Up @@ -330,7 +330,10 @@ private static string GetSavedSDKPath()

private static void SaveNewSDKPath(string path)
{
SessionState.EraseString(LabdriverFoundBackendPath);
// SDK path is changed. Clear these two.
EditorPrefs.DeleteKey(LabdriverFoundBackendPath);
SessionState.EraseString(AppSimShimLibSupport.SessionStateKey_ZISearchPaths);

EditorPrefs.SetString(SdkPathEditorPrefsKey, path);
mlsdkPath = path;
if (!ziPathOverrideToggle.value)
Expand All @@ -348,17 +351,18 @@ private static void SaveNewSDKPath(string path)

private static void LocateZIRuntimeFromMLSDK()
{
var path = SessionState.GetString(LabdriverFoundBackendPath, "");
if(Directory.Exists(path))
var path = EditorPrefs.GetString(LabdriverFoundBackendPath, "");
if (Directory.Exists(path)) // Use the stored path if valid so we don't need to invoke Labdriver any more.
{
if (path != ziRuntimePath)
{
ziRuntimePath = path;
ZIRuntimePathChangeEvt?.Invoke(ziRuntimePath);
}
return;
}

if(string.IsNullOrEmpty(ziRuntimePath) || !Directory.Exists(ziRuntimePath))
if (string.IsNullOrEmpty(ziRuntimePath) || !Directory.Exists(ziRuntimePath))
{
if(mlsdkPath.EndsWith("LAYOUT"))
{
Expand Down
Binary file added Plugins/Android/libMLAudioOutput.so
Binary file not shown.
76 changes: 76 additions & 0 deletions Plugins/Android/libMLAudioOutput.so.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Plugins/Android/libMagicLeapXrProvider.so
Binary file not shown.
Loading

0 comments on commit adce288

Please sign in to comment.