cancel
Showing results for 
Search instead for 
Did you mean: 

Avatars 2 SDK V12 Preset Avatar LoadFilter Error in Unity

Tomit
Level 2

In Premium Bowling we use preset avatars quite extensively: NPC crowd, PC VR players who can't setup a personalized avatar and Oculus players who choose not to set up a personalized avatar. We have 3 different avatar roles and corresponding avatar prefabs in Premium Bowling: first person avatar, locally controlled third person avatar (NPC) and remotely controlled third person avatar (online). Other differences aside, these 3 avatar prefabs have differences in Lod Flags and View Flags:

 

  • First person avatar: LOD_1, First Person
  • Local third person avatar: LOD_3, Third Person
  • Remote third person avatar: LOD_2, Third Person

 

It's quite normal in Premium Bowling to see the same preset avatar in different roles. As an example, the local player could have chosen to use preset 26 and remote online player might have chosen to use the preset 26 also. This would effectively mean that we'd need to instantiate the first person avatar prefab and load preset 26 into it and also instantiate the remote third person avatar prefab and load preset 26 into it as well.

 

This has worked fine in the past versions of Avatars V2. In our current production we're using build number 347180897 and it works fine. We're currently testing V12 and the issue we have is that trying to instantiate the same preset avatar into another role causes the following error:

 

[ovrAvatar2 native] asset::Found collection's loadFilter is not compatible
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Oculus.Avatar2.OvrAvatarLog:Log (Oculus.Avatar2.OvrAvatarLog/ELogLevel,string,string,UnityEngine.Object) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarLog.cs:101)
Oculus.Avatar2.OvrAvatarLog:LogCallBack (Oculus.Avatar2.CAPI/ovrAvatar2LogLevel,string,intptr) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarLog.cs:83)
Oculus.Avatar2.CAPI:OvrAvatarEntity_LoadUriWithFilters (Oculus.Avatar2.CAPI/ovrAvatar2EntityId,string,Oculus.Avatar2.CAPI/ovrAvatar2EntityFilters&,Oculus.Avatar2.CAPI/ovrAvatar2LoadRequestId&) (at Assets/GitExclude/Oculus/Avatar2/Scripts/CAPI/OvrAvatarAPI_Entity.cs:355)
Oculus.Avatar2.OvrAvatarEntity:LoadAssetsFromZipSource (string[],Oculus.Avatar2.CAPI/ovrAvatar2EntityLODFlags) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarEntity.cs:1035)
Oculus.Avatar2.OvrAvatarEntity:LoadAssetsFromZipSource (string[]) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarEntity.cs:1010)
SadAvatarEntity:LoadLocalAvatar () (at Assets/Scripts/Avatars/SadAvatarEntity.cs:348)
SadAvatarEntity/<StartRoutine>d__29:MoveNext () (at Assets/Scripts/Avatars/SadAvatarEntity.cs:117)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
SadAvatarEntity:InitEntity (int,ulong) (at Assets/Scripts/Avatars/SadAvatarEntity.cs:214)
AvatarsManager:CreateFirstPersonAvatarVisu (AvatarSpec) (at Assets/Scripts/Avatars/AvatarsManager.cs:271)
PlayerAvatarController:RefreshVisu () (at Assets/Scripts/Avatars/PlayerAvatarController.cs:336)
PlayerAvatarController:set_AvatarSpec (AvatarSpec) (at Assets/Scripts/Avatars/PlayerAvatarController.cs:244)
PlayerAvatarController:set_Owner (OurPlayerAccount) (at Assets/Scripts/Avatars/PlayerAvatarController.cs:74)
AvatarsManager:ReservePlayerAvatar (AvatarsManager/AvatarCreateRequest) (at Assets/Scripts/Avatars/AvatarsManager.cs:798)
AvatarsManager/<FulfillAvatarRequestsRoutine>d__70:MoveNext () (at Assets/Scripts/Avatars/AvatarsManager.cs:386)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

[ovrAvatar2 entity] Failed to load asset. UnmatchedLoadFilters at path: 26_rift.glb
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Oculus.Avatar2.OvrAvatarLog:Log (Oculus.Avatar2.OvrAvatarLog/ELogLevel,string,string,UnityEngine.Object) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarLog.cs:101)
Oculus.Avatar2.OvrAvatarLog:LogError (string,string,UnityEngine.Object) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarLog.cs:159)
Oculus.Avatar2.OvrAvatarEntity:LoadAssetsFromZipSource (string[],Oculus.Avatar2.CAPI/ovrAvatar2EntityLODFlags) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarEntity.cs:1043)
Oculus.Avatar2.OvrAvatarEntity:LoadAssetsFromZipSource (string[]) (at Assets/GitExclude/Oculus/Avatar2/Scripts/OvrAvatarEntity.cs:1010)
SadAvatarEntity:LoadLocalAvatar () (at Assets/Scripts/Avatars/SadAvatarEntity.cs:348)
SadAvatarEntity/<StartRoutine>d__29:MoveNext () (at Assets/Scripts/Avatars/SadAvatarEntity.cs:117)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
SadAvatarEntity:InitEntity (int,ulong) (at Assets/Scripts/Avatars/SadAvatarEntity.cs:214)
AvatarsManager:CreateFirstPersonAvatarVisu (AvatarSpec) (at Assets/Scripts/Avatars/AvatarsManager.cs:271)
PlayerAvatarController:RefreshVisu () (at Assets/Scripts/Avatars/PlayerAvatarController.cs:336)
PlayerAvatarController:set_AvatarSpec (AvatarSpec) (at Assets/Scripts/Avatars/PlayerAvatarController.cs:244)
PlayerAvatarController:set_Owner (OurPlayerAccount) (at Assets/Scripts/Avatars/PlayerAvatarController.cs:74)
AvatarsManager:ReservePlayerAvatar (AvatarsManager/AvatarCreateRequest) (at Assets/Scripts/Avatars/AvatarsManager.cs:798)
AvatarsManager/<FulfillAvatarRequestsRoutine>d__70:MoveNext () (at Assets/Scripts/Avatars/AvatarsManager.cs:386)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

3 REPLIES 3

mikedurand
Oculus Staff

Hi Tomit-

 

We are going to work on this issue and have a pretty good idea what the problem is. In the mean time you should make sure that you are NOT filtering out the head mesh when loading the preset and instead rely on the View Flags to include the head or not. The important thing is to avoid loading the same avatar with different mesh filters to avoid the bug.

 

-Mike

Hi, thanks for the info Mike! Loading the same avatar with different Lod Flags also causes the error. We haven't enabled all LOD versions for all avatar roles as it increases creation & memory overhead. 

 

- The first person avatar has only LOD_1 flag enabled; it's always viewed from head position.

 

- Local third person avatar (used for NPC Crowd) has LOD_3 to save resources

 

- Remote third person avatar (used for online players) has LOD_2 as they can be playing on same lane (=close)

 

If we'd need to enable LOD_1, LOD_2 and LOD_3 for all avatar roles, it would increase memory usage quite significantly. We never use LOD_1 for any other avatar than the first person. We also tested using LOD_2, LOD_3 for all avatars but that makes the hand of first person avatar a bit "rough". 

OK. We have landed a fix that we believe will address both multiple LoadFilter and multiple LODs. Thanks for reporting it and please look for the fix in the v14 release. 

 

-Mike