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