cancel
Showing results for 
Search instead for 
Did you mean: 

How to Access Raw Bytes of Meta Avatar CDN data?

Marielle_HPE
Explorer

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Marielle_HPE
Explorer

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.

View solution in original post

4 REPLIES 4

Marielle_HPE
Explorer

I was able to access my Oculus Meta CDN avatar files using this method:

  • save a copy of the authentication token
  • using the same URL from the Oculus logs, request the CDN packet again from my code
  • parse the json in the  returned CDN packet which contains 2 url files for a zip and glb file
  • Added code to the SampleAvatarEntity script to ReloadAvatarManually to also accept a url
  • Shipped the urls to a user on Windows

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.

Marielle_HPE
Explorer

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.

hari177
Honored Guest

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 ? 

Marielle_HPE
Explorer

Thank you!  I will investigate this and see how it works.

Thank you for your reply.