Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve avatar config handling #326

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ReadyPlayerMe.Core.Analytics;
using ReadyPlayerMe.Core.Data;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
Expand Down
1 change: 1 addition & 0 deletions Runtime/Core/Scripts/Utils/AvatarAPIParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public static class AvatarAPIParameters
public const string TEXTURE_ATLAS = "textureAtlas";
public const string TEXTURE_SIZE_LIMIT = "textureSizeLimit";
public const string TEXTURE_CHANNELS = "textureChannels";
public const string TEXTURE_FORMAT = "textureFormat";
public const string MORPH_TARGETS = "morphTargets";
public const string USE_HANDS = "useHands";
public const string USE_DRACO = "useDracoMeshCompression";
Expand Down
6 changes: 6 additions & 0 deletions Runtime/Core/Scripts/Utils/AvatarConfigProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ public static string ProcessAvatarConfiguration(AvatarConfig avatarConfig)
{
queryBuilder.AddKeyValue(AvatarAPIParameters.MORPH_TARGETS, CombineMorphTargetNames(avatarConfig.MorphTargets));
}
else
{
// If no morph targets are set, we set the value to "none" to prevent unwanted blendshapes.
queryBuilder.AddKeyValue(AvatarAPIParameters.MORPH_TARGETS, "none");
}
queryBuilder.AddKeyValue(AvatarAPIParameters.USE_HANDS, GetBoolStringValue(avatarConfig.UseHands));
queryBuilder.AddKeyValue(AvatarAPIParameters.USE_DRACO, GetBoolStringValue(avatarConfig.UseDracoCompression));
queryBuilder.AddKeyValue(AvatarAPIParameters.USE_MESHOPT, GetBoolStringValue(avatarConfig.UseMeshOptCompression));
queryBuilder.AddKeyValue(AvatarAPIParameters.TEXTURE_FORMAT, "jpeg");

return queryBuilder.Query;
}
Expand Down
1 change: 0 additions & 1 deletion Runtime/Core/Scripts/Utils/WebRequestDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public async Task<T> SendRequest<T>(
request.SetRequestHeader(header.Key, header.Value);
}
}

downloadHandler ??= new DownloadHandlerBuffer();

request.downloadHandler = downloadHandler;
Expand Down
Loading