An issue came up in a VisionOS project, using Polyspatial 2.0.4. We have some gameobjects with blend shapes, and in a timeline animation we occasionally disable and enable them, or they get enabled/disabled when resetting the timeline. We started getting the following error, which while in the mask also resulted in crashing the app.
Array index (0) is out of bounds (size=0)
UnityEngine.SkinnedMeshRenderer:SetBlendShapeWeight (int,single)
I created a clean project with just one empty scene and a gameobject with blendshapes, which I manually disabled and enabled from the hierarchy in play mode. I started adding back VisionOS stuff. I managed to reproduce the error, and realized the following:
In the Apple visionOS settings, if we have the AppMode set to Metal, disabling/enabling the object during play mode doesn’t give any errors. But if we switch the AppMode to Polyspatial, if I disable the object in play mode and then enable it again, I get the aforementioned error.
Here’s a link to a clean project with a scene called BlendShape_Polyspatial_Error
TestBlendShapes.zip
Obviously it should first be switched to a VisionOS build profile, and then you can try enabling-disabling the hole_earth gameobject in the scene a few times in both Metal mode and Polyspatial mode and see the errors in the console while in Polyspatial mode.