Search Unity

Blendshapes in animation vs in code (performance)

Discussion in 'Animation' started by Knosis_Co-Verse, Apr 21, 2021.

  1. Knosis_Co-Verse

    Knosis_Co-Verse

    Joined:
    Apr 23, 2019
    Posts:
    12
    Hi, I have a character with a lot of blendshapes and need to animate them. Ideally i would do it in code. However changing them in code with SkinnedMeshRenderer.SetBlendShapeWeight seems to be extremely slow while doing it in an animation is fine.

    My question is: Is there a better way to change blendshapes in code?
     
    Last edited: Apr 21, 2021
  2. Knosis_Co-Verse

    Knosis_Co-Verse

    Joined:
    Apr 23, 2019
    Posts:
    12
    Welp. It seems that having the skinned mesh focused on the inspector was the problem. Weird but not a problem anymore.
     
  3. launzone

    launzone

    Joined:
    Dec 2, 2015
    Posts:
    57
    yes i don't think there should be a difference in controlling a blendshape through code or though animation keyframes.