Skip to content

Commit

Permalink
Merge branch 'release/v7.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Jul 1, 2024
2 parents e7dc29b + c10e79a commit 0e67f78
Show file tree
Hide file tree
Showing 102 changed files with 9,896 additions and 91,842 deletions.
22 changes: 11 additions & 11 deletions .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

## Changelog

### Updated
## Updated

- XR animation avatars now have DOF enabled by default [#288](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/288)
- Updated InCreatorAvatarLoader to use avatar config [#286](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/286)
- Avatar Creator Icon categories updated [#272](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/272)
- loading circle animation now using MMecanim animation [#302](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/302)
- removed unnecessary assets from Resources folder [#303](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/303)
- updated Template avatar assets [#300](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/300)
- Avatar Body type now moved to CoreSettings [#290](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/290)

### Fixed
### Added

- Fixed an issue preventing LOD's from updating [#277](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/277)
- An issue causing multiple signup requests [#275](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/275)
- Added support for hero customization assets (costumes) [#301](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/301)
- templates can now be filtered by Bodytype [#296](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/296)

### Added
- Avatar template type filter [#270](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/270)
- Handle failed body shape requests [#281](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/281)
- Option to filter Templates by gender [#273](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/273)
### Fixed

- fixed an issue causing invalid load settings in Avatar Loader window [#298](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/298)
2 changes: 1 addition & 1 deletion .github/workflows/pr-test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runAllTests:
name: ${{ matrix.unityVersion }} ${{ matrix.testMode }} tests
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
Expand Down
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [6.3.1] - 2024.05.03
## [7.0.0] - 2024.07.01

## Updated

- loading circle animation now using MMecanim animation [#302](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/302)
- removed unnecessary assets from Resources folder [#303](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/303)
- updated Template avatar assets [#300](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/300)
- Avatar Body type now moved to CoreSettings [#290](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/290)

### Added

- Added support for hero customization assets (costumes) [#301](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/301)
- templates can now be filtered by Bodytype [#296](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/296)

### Fixed

- fixed an issue causing invalid load settings in Avatar Loader window [#298](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/298)

## [6.3.1] - 2024.06.18

### Fixed

- Cache can load now avatars from previous versions, that had bodytype set as an integer [#292](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/292)
- allow cache to be loaded from previous versions, where bodyType was stored as an integer [#293](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/293)

## [6.3.0] - 2024.06.11

Expand Down
13 changes: 8 additions & 5 deletions Editor/Core/Scripts/Analytics/AmplitudeEditorLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ public class AmplitudeEditorLogger : IAnalyticsEditorLogger
{
private const string SDK_TARGET = "Unity";

private readonly Dictionary<HelpSubject, string> helpDataMap = new Dictionary<HelpSubject, string>
private readonly Dictionary<HelpSubject, string> helpDataMap = new()
{
{ HelpSubject.AvatarCaching, "avatar caching" },
{ HelpSubject.Subdomain, "subdomain" },
{ HelpSubject.AvatarConfig, "avatar config" },
{ HelpSubject.GltfDeferAgent, "gltf defer agent" },
{ HelpSubject.LoadingAvatars, "download avatar into scene" }
{ HelpSubject.LoadingAvatars, "download avatar into scene" },
{
HelpSubject.Avatars, "avatars body type"
}
};

private bool isEnabled;
Expand Down Expand Up @@ -238,7 +241,7 @@ public void LogPackageInstalled(string id, string name)
LogEvent(EventName.INSTALL_PACKAGE, new Dictionary<string, object>
{
{ "id", id },
{ "name", name },
{ "name", name }
});
}

Expand All @@ -256,9 +259,9 @@ private void SetUserProperties()
{ Properties.ALLOW_ANALYTICS, true }
};

Dictionary<string, string> modules = ModuleList.GetInstalledModuleVersionDictionary();
var modules = ModuleList.GetInstalledModuleVersionDictionary();

foreach (KeyValuePair<string, string> module in modules)
foreach (var module in modules)
{
userProperties.Add(module.Key, module.Value);
}
Expand Down
1 change: 1 addition & 0 deletions Editor/Core/Scripts/Analytics/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public static class Links
public const string DOCS_AVATAR_LOADER_WINDOW = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/avatar-loader-window";
public const string DOCS_AVATAR_CONFIG_LINK = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/optimize/avatar-configuration";
public const string DOCS_AVATAR_CACHING = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/optimize/avatar-caching";
public const string AVATARS = "https://docs.readyplayer.me/ready-player-me/api-reference/avatars";
public const string APP_ID = "https://docs.readyplayer.me/ready-player-me/integration-guides/unity/avatar-creator/custom-avatar-creator#prerequisites";
}
}
Expand Down
3 changes: 2 additions & 1 deletion Editor/Core/Scripts/Analytics/HelpSubject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum HelpSubject
Subdomain,
AvatarConfig,
GltfDeferAgent,
LoadingAvatars
LoadingAvatars,
Avatars
}
}
6 changes: 6 additions & 0 deletions Editor/Core/Scripts/Settings/CoreSettingsSetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public static void SaveAppId(string appId)
Save();
}

public static void SaveBodyType(BodyType bodyType)
{
CoreSettingsHandler.CoreSettings.BodyType = bodyType;
Save();
}

public static void Save()
{
EditorUtility.SetDirty(CoreSettingsHandler.CoreSettings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ public void CreateGUI()
headerLabel.text = AVATAR_LOADER;

var useEyeAnimationsToggle = rootVisualElement.Q<Toggle>(USE_EYE_ANIMATIONS_TOGGLE);
useEyeAnimationsToggle.value = EditorPrefs.GetBool(EYE_ANIMATION_SAVE_KEY);
useEyeAnimations = EditorPrefs.GetBool(EYE_ANIMATION_SAVE_KEY);
useEyeAnimationsToggle.value = useEyeAnimations;
useEyeAnimationsToggle.RegisterCallback<ChangeEvent<bool>>(evt =>
{
useEyeAnimations = evt.newValue;
EditorPrefs.SetBool(EYE_ANIMATION_SAVE_KEY, useEyeAnimations);
});

var useVoiceToAnimToggle = rootVisualElement.Q<Toggle>(USE_VOICE_TO_ANIMATION_TOGGLE);
useVoiceToAnimToggle.value = EditorPrefs.GetBool(VOICE_TO_ANIM_SAVE_KEY);
useVoiceToAnim = EditorPrefs.GetBool(VOICE_TO_ANIM_SAVE_KEY);
useVoiceToAnimToggle.value = useVoiceToAnim;
useVoiceToAnimToggle.RegisterCallback<ChangeEvent<bool>>(evt =>
{
useVoiceToAnim = evt.newValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
<ui:Template name="HeaderTemplate" src="../Templates/HeaderTemplate.uxml" />
<Style src="../CommonStyle.uss" />
<ui:Template name="HeaderTemplate" src="project://database/Assets/Ready%20Player%20Me/Core/Editor/Core/Scripts/UI/EditorWindows/Templates/HeaderTemplate.uxml?fileID=9197481963319205126&amp;guid=07a53a11b73eff34685f226bf17a42d4&amp;type=3#HeaderTemplate" />
<Style src="project://database/Assets/Ready%20Player%20Me/Core/Editor/Core/Scripts/UI/EditorWindows/CommonStyle.uss?fileID=7433441132597879392&amp;guid=af10d225241bded4188e82d92db9230f&amp;type=3#CommonStyle" />
<ui:VisualElement style="align-items: center; width: 500px; margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: auto;">
<ui:Instance template="HeaderTemplate" name="HeaderTemplate" />
<ui:VisualElement name="PartnerSettingsHeading" class="heading">
Expand All @@ -13,6 +13,7 @@
<ui:Label text="Avatar Settings" display-tooltip-when-elided="true" class="headingText" />
</ui:VisualElement>
<ReadyPlayerMe.Core.Editor.AvatarConfigTemplate />
<ReadyPlayerMe.Core.Editor.AvatarBodyTypeTemplate />
<ReadyPlayerMe.Core.Editor.GltfDeferAgentTemplate />
</ui:VisualElement>
<ui:VisualElement name="AvatarCaching" style="flex-grow: 0; background-color: rgba(0, 0, 0, 0); flex-shrink: 0;">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.Linq;
using JetBrains.Annotations;
using ReadyPlayerMe.Core.Analytics;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
using Object = UnityEngine.Object;

namespace ReadyPlayerMe.Core.Editor
{
public class AvatarBodyTypeTemplate : VisualElement
{
private const string XML_PATH = "AvatarBodyTypeTemplate";
[CanBeNull] private const string AVATAR_BODY_TYPE_DROPDOWN_FIELD = "DropdownField";
private const string AVATAR_BODY_TYPE_HELP_BUTTON = "BodyTypeHelpButton";

public new class UxmlFactory : UxmlFactory<AvatarBodyTypeTemplate, UxmlTraits>
{
}
public new class UxmlTraits : VisualElement.UxmlTraits
{
}

public AvatarBodyTypeTemplate()
{
var visualTree = Resources.Load<VisualTreeAsset>(XML_PATH);
visualTree.CloneTree(this);

var bodyType = CoreSettingsHandler.CoreSettings.BodyType;

var field = this.Q<DropdownField>(AVATAR_BODY_TYPE_DROPDOWN_FIELD);
field.choices = Enum.GetNames(typeof(BodyType)).AsEnumerable().Where(bodyType => bodyType != BodyType.None.ToString()).ToList();
field.value = bodyType.ToString();
field.RegisterValueChangedCallback(OnBodyTypeChanged);
this.Q<Button>(AVATAR_BODY_TYPE_HELP_BUTTON).clicked += OnHelpButtonClicked;
}

private void OnHelpButtonClicked()
{
AnalyticsEditorLogger.EventLogger.LogFindOutMore(HelpSubject.Avatars);
Application.OpenURL(Constants.Links.AVATARS);
}

private void OnBodyTypeChanged(ChangeEvent<string> evt)
{
var newBodyType = Enum.Parse<BodyType>(evt.newValue);
CoreSettingsSetter.SaveBodyType(newBodyType);
}
}
}

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
@@ -0,0 +1,9 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
<ui:VisualElement name="Container" style="flex-grow: 0; background-color: rgba(0, 0, 0, 0); flex-direction: row; align-items: center; justify-content: flex-start; align-self: flex-start; margin-left: 15px; margin-right: 15px; flex-shrink: 1;">
<ui:VisualElement name="LabelAndHelpButton" style="flex-grow: 0; background-color: rgba(0, 0, 0, 0); flex-direction: row; align-items: center; justify-content: flex-start; align-self: center; min-width: 145px;">
<ui:Label tabindex="-1" text="Avatar Body Type" display-tooltip-when-elided="true" enable-rich-text="true" name="BodyTypeLabel" style="height: 33px; -unity-text-align: middle-left;" />
<ui:Button text="?" display-tooltip-when-elided="true" name="BodyTypeHelpButton" class="button2" style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; width: 20px; height: 20px; border-top-left-radius: 15px; border-bottom-left-radius: 15px; border-top-right-radius: 15px; border-bottom-right-radius: 15px; -unity-text-align: middle-center; white-space: nowrap;" />
</ui:VisualElement>
<ui:DropdownField index="-1" name="DropdownField" style="width: 318px; max-width: initial; min-width: initial; margin-left: 0;" />
</ui:VisualElement>
</ui:UXML>

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

Binary file removed Resources/RPM_Template_Mesh.glb
Binary file not shown.
Binary file removed Resources/RPM_Template_Mesh_XR.glb
Binary file not shown.
4 changes: 3 additions & 1 deletion Runtime/AvatarCreator/Scripts/Data/AssetType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public enum AssetType
Footwear,
[AssetTypeFilter(AssetFilter.Template)]
AvatarTemplate,
BodyShape
BodyShape,
[AssetTypeFilter(AssetFilter.Style)]
Costume
}

public enum AssetFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static bool IsOptionalAsset(this AssetType assetType)
case AssetType.Outfit:
case AssetType.Shirt:
case AssetType.EyebrowStyle:
case AssetType.Costume:
return false;
default:
return !assetType.IsColorAsset();
Expand Down
42 changes: 42 additions & 0 deletions Runtime/AvatarCreator/Scripts/Extensions/TaskExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System;
using System.Threading.Tasks;

namespace ReadyPlayerMe.AvatarCreator
{
public static class TaskExtensions
{
public const string ON_REQUEST_CANCELLED_MESSAGE = "Request was cancelled";
private const string ON_OPERATION_CANCELLED_MESSAGE = "Operation was cancelled";
public static async Task HandleCancellation(Task taskToWait, Action onSuccess = null)
{
try
{
await taskToWait;
onSuccess?.Invoke();
}
catch (Exception ex)
{
if (ex.Message != ON_REQUEST_CANCELLED_MESSAGE && ex.Message != ON_OPERATION_CANCELLED_MESSAGE)
{
throw;
}
}
}

public static async Task<T> HandleCancellation<T>(Task<T> taskToWait)
{
try
{
return await taskToWait;
}
catch (Exception ex)
{
if (ex.Message != ON_REQUEST_CANCELLED_MESSAGE && ex.Message != ON_OPERATION_CANCELLED_MESSAGE)
{
throw;
}
}
return default;
}
}
}

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

10 changes: 5 additions & 5 deletions Runtime/AvatarCreator/Scripts/InCreatorAvatarLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace ReadyPlayerMe.AvatarCreator
public class InCreatorAvatarLoader
{
private readonly AvatarConfig avatarConfig;

public InCreatorAvatarLoader(AvatarConfig avatarConfig = null)
{
if (avatarConfig == null)
Expand All @@ -19,11 +19,11 @@ public InCreatorAvatarLoader(AvatarConfig avatarConfig = null)
}
this.avatarConfig = avatarConfig;
}
public async Task<GameObject> Load(string avatarId, BodyType bodyType, OutfitGender gender, byte[] data)

public async Task<GameObject> Load(string avatarId, OutfitGender gender, byte[] data)
{
var avatarMetadata = new AvatarMetadata();
avatarMetadata.BodyType = bodyType;
avatarMetadata.BodyType = CoreSettingsHandler.CoreSettings.BodyType;
avatarMetadata.OutfitGender = gender;

var context = new AvatarContext();
Expand All @@ -37,7 +37,7 @@ public async Task<GameObject> Load(string avatarId, BodyType bodyType, OutfitGen
new GltFastAvatarImporter(),
new AvatarProcessor()
});

try
{
context = await executor.Execute(context);
Expand Down
Loading

0 comments on commit 0e67f78

Please sign in to comment.