protected void UpdateSkinnedMesh(OvrAvatar avatar, Transform bones, ovrAvatarTransform localTransform, ovrAvatarVisibilityFlags visibilityMask, IntPtr renderPart)
////i added this top rule:
if (blendShapeFailCount<5 && blendParams.blendShapeParamCount > mesh.sharedMesh.blendShapeCount)
for (uint i = 0; i < blendParams.blendShapeParamCount; i++)
float value = blendParams.blendShapeParams[i];
mesh.SetBlendShapeWeight((int)i, value * 100.0f);
One of my users haven't set their avatar, and this was throwing non stop out of bounds exceptions into the logs. Seems like a typo, but if i<bones.length, the sub block shouldn't ever be entered.
I'm on version (v1.37) of oculus integration for unity. (2019.1.2f1)
Array index (1) is out of bounds (size=0)
OvrAvatarRenderComponent:UpdateSkinnedMesh(OvrAvatar, Transform, ovrAvatarTransform, ovrAvatarVisibilityFlags, IntPtr)
OvrAvatarSkinnedMeshRenderComponent:UpdateSkinnedMeshRender(OvrAvatarComponent, OvrAvatar, IntPtr)
I have resolved the issue as i mentioned above by having a blendShapeFailCount.
.. public void ValidateTextures()
A fresh oculus SDK install in unity for mobile is throwing error from here. We fixed it by adding a return statement immediately the function header. Nothing seems to break when i do that, but avatar doesn't work when I don't.
Additionally, a handful of fallback textures are empty in OvrAvatarMaterialManager.
Finally, the OVR Avatar component, comes with unassigned shaders. I did my best to guess what belongs, but the result is it looks different than it did before the previous version of oculus SDK.
actually regarding the last thing..looks like it was just an issue with updating from a previous version where these fields weren't assigned. I looked at the sample scenes, and there the avatar had the proper things assigned.
One more thing. It appears that Oculus avatar is producing 1.7kb of GC allocation per frame.
A lot of it looks like it has to do with Marshalling data from the native side.