08-19-2022 05:58 PM
I have the Meta Avatars working in a networked app on the Oculus Quest. Now I want to get the raw bytes of the Avatar data retrieved from the CDN so I can send them to a room server that can send this data out to users on other platforms so that they won't have to contact the CDN. Is this even possible??
I've been looking at the OvrAvatarEntity classes to see if there is anyway to dump the avatar data. But I only see plenty of ways to load raw data into an avatar.
Thank you for any suggestions.
Solved! Go to Solution.
08-21-2022 12:12 PM
I finally have this working on Windows. On the Oculus, I now load the following url:
string uri = "https://graph.oculus.com/" + _localAvatar._userId + "?fields=id,avatar_v3{model.profile(fastload_v04).platform(pc).sdk_version(Avatar2%20runtime%20SDK%2015.0.0.40.89%20client%20SDK%2015.0.0.40.89).client_version(0.1%2B2021.3.6f1).client_name(DefaultCompany.Avatar){url,id,creation_time,animation_set}}";
My original url that I found in the Oculus logs used a profile of quest2_v04 but when I switched to fastload_v04, then the json would contain url pointers to assets that could be rendered on Windows. Also, the fastload assets are not as crisp as I would like but it will have to do.
I then take the json returned from the http request and parse out both urls for the avatar assets and send them to the windows user who reloads the avatar manually from the urls. I have tested that the Windows exe works on machines that do not have Oculus home installed and will display the correct Avatar CDN assets of Oculus users that are in the same room.
Please note that the above http request requires your auth token be attached. Also, I had to make a few enhancements in the Oculus Integration code to get all this working.
08-20-2022 08:07 PM
I was able to access my Oculus Meta CDN avatar files using this method:
The good news is that the Windows user can access the CDN avatar files using the urls without authenticating or using an API key. The bad news is that the textures aren't supported on Windows:
[ovrAvatar2 ovrAvatarPrimitive][Debug] Created image for id 1467
Texture creation failed. 'ASTC_6x6' is not supported on this platform. Use 'SystemInfo.SupportsTextureFormat' C# API to check format support.
[ovrAvatar2 ovrAvatarImage] Unable to create texture with size (2048, 2048) and formats (ASTC_RGBA_6x6, ASTC_6x6)
[ovrAvatar2 ovrAvatarPrimitive][Debug] Created image for id 1468
Texture creation failed. 'ASTC_6x6' is not supported on this platform. Use 'SystemInfo.SupportsTextureFormat' C# API to check format support.
[ovrAvatar2 ovrAvatarImage] Unable to create texture with size (2048, 2048) and formats (ASTC_RGBA_6x6, ASTC_6x6)
Does anyone have any suggestions? I was so close to having it all working 😞
Thank you.
08-21-2022 12:12 PM
I finally have this working on Windows. On the Oculus, I now load the following url:
string uri = "https://graph.oculus.com/" + _localAvatar._userId + "?fields=id,avatar_v3{model.profile(fastload_v04).platform(pc).sdk_version(Avatar2%20runtime%20SDK%2015.0.0.40.89%20client%20SDK%2015.0.0.40.89).client_version(0.1%2B2021.3.6f1).client_name(DefaultCompany.Avatar){url,id,creation_time,animation_set}}";
My original url that I found in the Oculus logs used a profile of quest2_v04 but when I switched to fastload_v04, then the json would contain url pointers to assets that could be rendered on Windows. Also, the fastload assets are not as crisp as I would like but it will have to do.
I then take the json returned from the http request and parse out both urls for the avatar assets and send them to the windows user who reloads the avatar manually from the urls. I have tested that the Windows exe works on machines that do not have Oculus home installed and will display the correct Avatar CDN assets of Oculus users that are in the same room.
Please note that the above http request requires your auth token be attached. Also, I had to make a few enhancements in the Oculus Integration code to get all this working.
09-13-2022 01:29 AM
But why do you need to go through all this trouble, when using https://developer.oculus.com/documentation/unity/meta-avatars-cross-play/ you can load avatars in other platforms ?
09-22-2022 11:42 AM
Thank you! I will investigate this and see how it works.
Thank you for your reply.