I'm running into something I believe is a bug with blend shapes, but I'm not sure. If I do this: Code (csharp): var model = Instantiate(prefab); model.skinnedMeshRenderer.SetBlendShapeWeight(index, value); That blend shape weight won't be applied until the next frame, meaning that the skinned mesh renderer is visible for a single frame with the wrong weight. If I do this: Code (csharp): var model = Instantiate(prefab); model.skinnedMeshRenderer.SetBlendShapeWeight(index, value); model.skinnedMeshRenderer.enabled = false; yield return null; model.skinnedMeshRenderer.enabled = true; I still get the same effect, just one frame delayed. In fact: Code (csharp): var model = Instantiate(prefab); model.skinnedMeshRenderer.SetBlendShapeWeight(index, value); model.skinnedMeshRenderer.enabled = false; yield return null; model.skinnedMeshRenderer.enabled = true; yield return null; model.skinnedMeshRenderer.enabled = false; yield return null; model.skinnedMeshRenderer.enabled = true; yield return null; model.skinnedMeshRenderer.enabled = false; yield return null; model.skinnedMeshRenderer.enabled = true; yield return null; yield return null; // This is the first point where the blend shape weight will be visible Two questions: Is this a bug? Is it possible to force blend shapes to apply somehow?
Definitely sounds like a bug. Try yield return new WaitForEndOfFrame. No idea if it will help, but it gives a slightly different time to null. I guess you could also try destroying the renderer and creating a new one, but that's a S***ty hack at best.
The SkinnedMeshRenderer is closely related to the GPU , so it seems that their work is not synchronized with the scripts. You can try to use SkindMeshRender. BakeMesh () then apply resulting mesh to MeshFilter. It will be dramaticly slow but will performed in same frame that called.