Skip to content

Commit

Permalink
Merge branch 'hotfix/v4.0.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Nov 14, 2023
2 parents 3fbf64a + 1dbf7e5 commit d0d0d02
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
11 changes: 2 additions & 9 deletions .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@

## Changelog

### Breaking Changes
- Merge avatar creator into core by @ryuuk in [#135](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/135).
- AvatarProcessor no longer searches and replaces existing avatar by @rk132 in [#138](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/138)

### Added
- show Avatar Creator sample button in guide by @ryuuk in [#141](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/141)

### Updated
- merged related samples into single folders by @harrisonhough in [#139](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/139)
### Updates
- fixed an issue causing avatars to be stored locally even if caching was disabled by @harrisonhough in [#150](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/150)
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.0.1] - 2023.11.14

### Fixed
- fixed an issue causing avatars to be stored locally even if caching was disabled by @harrisonhough in [#150](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/150)

## [4.0.0] - 2023.11.01

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion Editor/Module Management/ModuleList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ModuleList
name = "com.readyplayerme.core",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-core.git",
branch = "",
version = "4.0.0"
version = "4.0.1"
};

/// <summary>
Expand Down
10 changes: 8 additions & 2 deletions Editor/UI/EditorWindows/AvatarLoaderEditor/AvatarLoaderEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace ReadyPlayerMe.Core.Editor
{
public class AvatarLoaderEditor : EditorWindow
{
private const string TAG = nameof(AvatarLoaderEditor);
private const string AVATAR_LOADER = "Avatar Loader";
private const string LOAD_AVATAR_BUTTON = "LoadAvatarButton";
private const string HEADER_LABEL = "HeaderLabel";
Expand Down Expand Up @@ -83,7 +84,6 @@ private void LoadAvatar(string url)
avatarLoaderSettings = AvatarLoaderSettings.LoadSettings();
}
var avatarLoader = new AvatarObjectLoader();
avatarLoader.SaveInProjectFolder = true;
avatarLoader.OnFailed += Failed;
avatarLoader.OnCompleted += Completed;
avatarLoader.OperationCompleted += OnOperationCompleted;
Expand Down Expand Up @@ -113,18 +113,24 @@ private void Failed(object sender, FailureEventArgs args)

private void Completed(object sender, CompletionEventArgs args)
{
AnalyticsEditorLogger.EventLogger.LogAvatarLoaded(EditorApplication.timeSinceStartup - startTime);

if (avatarLoaderSettings == null)
{
avatarLoaderSettings = AvatarLoaderSettings.LoadSettings();
}
var paramHash = AvatarCache.GetAvatarConfigurationHash(avatarLoaderSettings.AvatarConfig);
var path = $"{DirectoryUtility.GetRelativeProjectPath(args.Avatar.name, paramHash)}/{args.Avatar.name}";
if (!AvatarLoaderSettings.LoadSettings().AvatarCachingEnabled)
{
SDKLogger.LogWarning(TAG, "Enable Avatar Caching to generate a prefab in the project folder.");
return;
}
GameObject avatar = EditorUtilities.CreateAvatarPrefab(args.Metadata, path);
if (useEyeAnimations) avatar.AddComponent<EyeAnimationHandler>();
if (useVoiceToAnim) avatar.AddComponent<VoiceHandler>();
DestroyImmediate(args.Avatar, true);
Selection.activeObject = avatar;
AnalyticsEditorLogger.EventLogger.LogAvatarLoaded(EditorApplication.timeSinceStartup - startTime);
}
}
}
3 changes: 0 additions & 3 deletions Runtime/AvatarObjectLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public AvatarObjectLoader(bool useDefaultGLTFDeferAgent = true)
}
}

/// If true, saves the avatar in the Asset folder.
public bool SaveInProjectFolder { get; set; }

/// Set the timeout for download requests
public int Timeout { get; set; } = 20;

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Data/ApplicationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ReadyPlayerMe.Core
{
public static class ApplicationData
{
private const string SDK_VERSION = "v4.0.0";
private const string SDK_VERSION = "v4.0.1";
private const string TAG = "ApplicationData";
private const string DEFAULT_RENDER_PIPELINE = "Built-In Render Pipeline";
private static readonly AppData Data;
Expand Down
3 changes: 2 additions & 1 deletion Runtime/Operations/AvatarDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public async Task<AvatarContext> Execute(AvatarContext context, CancellationToke
{
throw new InvalidDataException($"Expected cast {typeof(string)} instead got ");
}

DirectoryUtility.ValidateAvatarSaveDirectory(context.AvatarUri.Guid, context.ParametersHash);

if ((!context.IsUpdateRequired || Application.internetReachability == NetworkReachability.NotReachable)
Expand All @@ -68,7 +69,7 @@ public async Task<AvatarContext> Execute(AvatarContext context, CancellationToke
AvatarCache.DeleteAvatarModel(context.AvatarUri.Guid, context.ParametersHash);
}

if (downloadInMemory)
if (!context.AvatarCachingEnabled || downloadInMemory)
{
context.Bytes = await DownloadIntoMemory(context.AvatarUri.ModelUrl, context.AvatarConfig, token);
return context;
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Operations/MetadataDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<AvatarContext> Execute(AvatarContext context, CancellationToke
{
AvatarMetadata metadata = await Download(context.AvatarUri.MetadataUrl, token);
context = UpdateContext(context, metadata);
if (context.IsUpdateRequired)
if (context.IsUpdateRequired && context.AvatarCachingEnabled)
{
SaveMetadataToFile(context);
}
Expand Down Expand Up @@ -91,7 +91,7 @@ private AvatarContext UpdateContext(AvatarContext avatarContext, AvatarMetadata
{
var message = error.Message;
var failureType = error.FailureType;

if (failureType == FailureType.MetadataParseError)
{
failureType = error.FailureType;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.readyplayerme.core",
"version": "4.0.0",
"version": "4.0.1",
"displayName": "Ready Player Me Core",
"description": "This Module contains all the core functionality required for using Ready Player Me avatars in Unity, including features such as: \n - Module management and automatic package setup logic\n - Avatar loading from .glb files \n - Avatar creation \n - Avatar and 2D render requests \n - Optional Analytics\n - Custom editor windows\n - Sample scenes and assets",
"unity": "2020.3",
Expand Down

0 comments on commit d0d0d02

Please sign in to comment.