Search Unity

Apply blend shape same frame

Discussion in 'Animation' started by Baste, Jun 26, 2019.

  1. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Hi!

    We've got a system for changing character's faces using blend shapes. When we enter a dialogue with a character, we enable the character model singleton object, and set all the correct blend shapes on the face mesh:

    Code (csharp):
    1. // approximately what I'm doing
    2. var model = GetCharacterFromPool();
    3. model.skinnedMeshRenderer.SetBlendShapeWeight(faceIndex, faceValue);
    4. model.gameObject.SetActive();
    The problem is that these blend shapes doesn't take effect until the next frame, so there's a single frame visible where the character has the wrong face, before it suddenly snaps to the next face.

    The blend shape is set as a part of the normal Update loop.

    Is there any way for me to force a skinned mesh renderer to instantly apply the current blend shape?