Resetting Avatar Editing Sessions in the Avatar Creator

Hi,

In the AvatarCreatorElements sample, I follow these steps

  • Play Scene
  • Select a hat for the avatar. The hat appears on the avatar. Don’t save the avatar.
  • Stop the scene
  • Play the scene again. The avatar loads without the hat. This is the expected behavior since it wasn’t saved with the hat.
  • Add a top to the avatar. The top appears, but so does the hat.

My understanding is that the editing session is not reset when the avatar is reloaded. So even if I restart editing the avatar in a new session, it will continue from the previous editing state (with the hat), ignoring that the avatar has been reloaded to its previous saved state. Is this correct? I would like to be able to reset the editing session on demand, otherwise this workflow doesn’t make much sense to me. Is there any API call to achieve this?

As a temporary fix, I have created this method in AvatarManager.cs. I call it after reloading the avatar, to make sure that the avatar update session comes back to the same assetProperties of the loaded avatar. But I am sure there must be a better way:

        public async Task ResetAssets()
        {
            
            var assetProperties = await GetAvatarProperties(avatarId);

            byte[] data;
            try
            {
                data = await avatarAPIRequests.UpdateAvatar(avatarId, assetProperties, avatarConfigParameters);
            }
            catch (Exception e)
            {
                HandleException(e);
            }
        
        }

Thank you

Hi Martin,

There is a UrlConfig that can be adjusted In Unity. You can enable “Clear Cache” and it will reset the Avatar every time.

By default it is set to disabled. See the Image below:
image (38)

Hi Markus. Thanks for your reply. I can’t access my Unity project right now, but I don’t remember seeing the Web Frame Handler in the AvatarCreatorElements sample. Could it be for the webview version? In that case, I don’t think it applies to my specific case because I’m building my own Avatar Creator in Unity.

In the meantime, I’ll take a look at the Web Frame Handler script and see if I can replicate the same logic in my project.

Hi @Martin

In this you could check the Avatar Caching option in your Ready Player Me settings. You can turn caching on/off via Unity. More information below:
Avatar Caching | Ready Player Me