Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.5.0] - 2022-07-22
### Fixed
  • Loading branch information
Unity Technologies committed Jul 22, 2022
1 parent 2f15342 commit dc5c2b9
Show file tree
Hide file tree
Showing 103 changed files with 2,695 additions and 1,145 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.5.0-exp.1] - 2022-07-12
## [1.5.0] - 2022-07-22
### Fixed
* Fixed compilation errors on Game Core platforms where `ENABLE_VR` is not currently defined. Requires Input System 1.4.0 or newer.
* Fixed an issue that was causing Oculus Android Vulkan builds rendering broken after sleep / awake HMD.
Expand All @@ -18,13 +18,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Updated Input System dependency to 1.4.1.

### Added
* Added **experimental** support for Late Latching Head node when using Vulkan.
* Added generic Project Validation status in the **Project Settings** window under **XR Plug-in Management** if you have [XR Core Utilities](https://docs.unity3d.com/Packages/com.unity.xr.core-utils@latest) 2.1.0 or later installed. These results include the checks for all XR plug-ins that provide validation rules.
* Added API `OpenXRFeature.SetEnvironmentBlendMode` to set the current XR Environment Blend Mode if it is supported by the active runtime. If not supported, fall back to the runtime preference.
* Added API `OpenXRFeature.GetEnvironmentBlendMode` to return the current XR Environment Blend Mode.
* Added support for `XR_MSFT_holographic_windown_attachment` extension on UWP so that installing Microsoft Mixed Reality OpenXR Plug-in is no longer required if targeting HoloLens V2 devices. And removed corresponding project validator.
* Added support for `XR_FB_foveation`, `XR_FB_foveation_configuration`, `XR_FB_swapchain_update_state`, `XR_FB_foveation_vulkan` and `XR_FB_space_warp` extensions.
* Added ability to recover the application after Oculus Link was aborted and re-established. Attempt to restart every 5 seconds after Link disconnected.
* Added validation rule for duplicate settings in OpenXRPackageSettings.asset.

## [1.4.2] - 2022-05-12
### Fixed
Expand Down Expand Up @@ -73,7 +73,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Added API `OpenXRInput.TryGetInputSourceName`
* Added event `OpenXRRuntime.wantsToRestart`
* Added event `OpenXRRuntime.wantsToQuit`
* Added support for `XR_OCULUS_audio_device_guid` extension.
* Added support for `XR_OCULUS_audio_device_guid
` extension.
* Added `Haptic` control to OpenXR Controller Profile layouts that can be bound to an action and used to trigger haptics using the new `OpenXRInput.SendHapticImpulse` API.

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion ConformanceAutomation/android.meta

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/android/arm64.meta

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

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows.meta

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows/arm32.meta

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

Binary file not shown.

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows/arm64.meta

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

Binary file not shown.

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows/x64.meta

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

Binary file not shown.

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/windows.meta

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

2 changes: 1 addition & 1 deletion ConformanceAutomation/windows/x64.meta

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

Binary file modified ConformanceAutomation/windows/x64/ConformanceAutomationExt.dll
Binary file not shown.

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

38 changes: 29 additions & 9 deletions Editor/OpenXRPackageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ public static OpenXRPackageSettings Instance
EditorBuildSettings.TryGetConfigObject(Constants.k_SettingsKey, out ret);
if (ret == null)
{
string searchText = String.Format("t:OpenXRPackageSettings");
string[] assets = AssetDatabase.FindAssets(searchText);
if (assets.Length > 0)
string path = OpenXRPackageSettingsAssetPath();
if (!path.Equals(String.Empty))
{
string path = AssetDatabase.GUIDToAssetPath(assets[0]);
ret = AssetDatabase.LoadAssetAtPath(path, typeof(OpenXRPackageSettings)) as OpenXRPackageSettings;
EditorBuildSettings.AddConfigObject(Constants.k_SettingsKey, ret, true);
if (ret != null)
{
EditorBuildSettings.AddConfigObject(Constants.k_SettingsKey, ret, true);
}

// Can't modify EditorBuildSettings once a build has already started - it won't get picked up
// Not sure how to gracefully fix this, for now fail the build so there are now surprises.
if (BuildPipeline.isBuildingPlayer)
Expand All @@ -57,8 +59,8 @@ public static OpenXRPackageSettings GetOrCreateInstance()
OpenXRPackageSettings settings = ScriptableObject.CreateInstance<OpenXRPackageSettings>();
if (settings != null)
{
string newAssetName = String.Format("OpenXR Package Settings.asset");
string assetPath = GetAssetPathForComponents(s_DefaultSettingsPath);
string newAssetName = String.Format(s_PackageSettingsAssetName);
string assetPath = GetAssetPathForComponents(s_PackageSettingsDefaultSettingsPath);
if (!string.IsNullOrEmpty(assetPath))
{
assetPath = Path.Combine(assetPath, newAssetName);
Expand All @@ -69,8 +71,21 @@ public static OpenXRPackageSettings GetOrCreateInstance()
return settings;
}

private static readonly string[] s_DefaultSettingsPath = {"XR","Settings"};
private static string GetAssetPathForComponents(string[] pathComponents, string root = "Assets")
internal static readonly string s_PackageSettingsAssetName = "OpenXR Package Settings.asset";

internal static readonly string[] s_PackageSettingsDefaultSettingsPath = {"XR","Settings"};

string IPackageSettings.PackageSettingsAssetPath()
{
return OpenXRPackageSettingsAssetPath();
}

internal static string OpenXRPackageSettingsAssetPath()
{
return Path.Combine(GetAssetPathForComponents(s_PackageSettingsDefaultSettingsPath), s_PackageSettingsAssetName);
}

internal static string GetAssetPathForComponents(string[] pathComponents, string root = "Assets")
{
if (pathComponents.Length <= 0)
return null;
Expand Down Expand Up @@ -102,6 +117,11 @@ public string GetActiveLoaderLibraryPath()
return OpenXRChooseRuntimeLibraries.GetLoaderLibraryPath();
}

void IPackageSettings.RefreshFeatureSets()
{
OpenXRFeatureSetManager.InitializeFeatureSets();
}

private bool IsValidBuildTargetGroup(BuildTargetGroup buildTargetGroup) =>
buildTargetGroup == BuildTargetGroup.Standalone ||
Enum.GetValues(typeof(BuildTarget)).Cast<BuildTarget>().Any(bt =>
Expand Down
2 changes: 1 addition & 1 deletion MockRuntime/windows.meta

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

2 changes: 1 addition & 1 deletion MockRuntime/windows/x64.meta

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

Binary file modified MockRuntime/windows/x64/mock_runtime.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion MockRuntime/windows/x64/mock_runtime.dll.meta

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

Binary file modified MockRuntime/windows/x64/openxr_loader.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion MockRuntime/windows/x64/openxr_loader.dll.meta

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

73 changes: 70 additions & 3 deletions Runtime/OpenXRProjectValidation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditor.XR.Management;
Expand All @@ -24,13 +25,20 @@ public static class OpenXRProjectValidation
new OpenXRFeature.ValidationRule
{
message = "The OpenXR package has been updated and Unity must be restarted to complete the update.",
checkPredicate = () => (!OpenXRSettings.Instance.versionChanged),
checkPredicate = () => OpenXRSettings.Instance == null || (!OpenXRSettings.Instance.versionChanged),
fixIt = RequireRestart,
error = true,
errorEnteringPlaymode = true,
buildTargetGroup = BuildTargetGroup.Standalone,
},

new OpenXRFeature.ValidationRule
{
message = "The OpenXR Package Settings asset has duplicate settings and must be regenerated.",
checkPredicate = AssetHasNoDuplicates,
fixIt = RegenerateXRPackageSettingsAsset,
error = false,
errorEnteringPlaymode = false
},
new OpenXRFeature.ValidationRule()
{
message = "Gamma Color Space is not supported when using OpenGLES.",
Expand Down Expand Up @@ -68,7 +76,11 @@ public static class OpenXRProjectValidation
new OpenXRFeature.ValidationRule()
{
message = "At least one interaction profile must be added. Please select which controllers you will be testing against in the Features menu.",
checkPredicate = () => OpenXRSettings.GetSettingsForBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup).GetFeatures<OpenXRInteractionFeature>().Any(f => f.enabled),
checkPredicate = () =>
{
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
return settings == null || settings.GetFeatures<OpenXRInteractionFeature>().Any(f => f.enabled);
},
fixIt = OpenProjectSettings,
fixItAutomatic = false,
fixItMessage = "Open Project Settings to select one or more interaction profiles."
Expand Down Expand Up @@ -154,6 +166,61 @@ public static class OpenXRProjectValidation

private static readonly List<OpenXRFeature.ValidationRule> CachedValidationList = new List<OpenXRFeature.ValidationRule>(BuiltinValidationRules.Length);

internal static bool AssetHasNoDuplicates()
{
var packageSettings = OpenXRSettings.GetPackageSettings();
if (packageSettings == null)
{
return true;
}

string path = packageSettings.PackageSettingsAssetPath();
var loadedAssets = AssetDatabase.LoadAllAssetsAtPath(path);
if (loadedAssets == null)
{
return true;
}

// Check for duplicate "full" feature name (Feature class type name + Feature name (contains BuildTargetGroup))
HashSet<string> fullFeatureNames = new HashSet<string>();
foreach (var loadedAsset in loadedAssets)
{
OpenXRFeature individualFeature = loadedAsset as OpenXRFeature;
if (individualFeature != null)
{
Type type = individualFeature.GetType();
string featureName = individualFeature.name;
string fullFeatureName = type.FullName + "\\" + featureName;

if (fullFeatureNames.Contains(fullFeatureName))
return false;
fullFeatureNames.Add(fullFeatureName);
}
}

return true;
}

internal static void RegenerateXRPackageSettingsAsset()
{
// Deleting the OpenXR PackageSettings asset also destroys the OpenXRPackageSettings object.
// Need to get the static method to create the new asset and object before deleting the asset.
var packageSettings = OpenXRSettings.GetPackageSettings();
if (packageSettings == null)
{
return;
}

string path = packageSettings.PackageSettingsAssetPath();

Action createAssetCallback = packageSettings.RefreshFeatureSets;
AssetDatabase.DeleteAsset(path);

EditorBuildSettings.RemoveConfigObject(Constants.k_SettingsKey);

createAssetCallback();
}

/// <summary>
/// Open the OpenXR project settings
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions Runtime/OpenXRSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public interface IPackageSettings
/// <typeparam name="T">Feature type</typeparam>
/// <returns>All known features of the given type within the package settings</returns>
public IEnumerable<(BuildTargetGroup buildTargetGroup, T feature)> GetFeatures<T>() where T : OpenXRFeature;

internal void RefreshFeatureSets();

internal string PackageSettingsAssetPath();
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion Runtime/UnitySubsystemsManifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "OpenXR XR Plugin",
"version": "1.5.0-exp.1",
"version": "1.5.0",
"libraryName": "UnityOpenXR",
"displays": [
{
Expand Down
2 changes: 1 addition & 1 deletion Runtime/android.meta

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

2 changes: 1 addition & 1 deletion Runtime/android/arm64.meta

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

Binary file modified Runtime/android/arm64/libUnityOpenXR.so
Binary file not shown.
2 changes: 1 addition & 1 deletion Runtime/android/arm64/libUnityOpenXR.so.meta

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

2 changes: 1 addition & 1 deletion Runtime/universalwindows.meta

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

2 changes: 1 addition & 1 deletion Runtime/universalwindows/arm32.meta

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

Binary file modified Runtime/universalwindows/arm32/UnityOpenXR.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Runtime/universalwindows/arm32/UnityOpenXR.dll.meta

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

2 changes: 1 addition & 1 deletion Runtime/universalwindows/arm64.meta

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

Binary file modified Runtime/universalwindows/arm64/UnityOpenXR.dll
Binary file not shown.
Loading

0 comments on commit dc5c2b9

Please sign in to comment.