Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Combining legacy animation system with Mechanim

Discussion in 'Animation' started by Bartek_Gudowski_Friend_Factory, Apr 19, 2019.

  1. Bartek_Gudowski_Friend_Factory

    Bartek_Gudowski_Friend_Factory

    Joined:
    Feb 18, 2019
    Posts:
    54
    I have a question how to combine the Unity legacy animation system together with the Mechanim system. We are creating a facial animation during runtime on iOS build, and because of the iOS build it has to use the Unity legacy animation system. The problem that appears is that the character needs to use a Mechanim system for body animations and the legacy system for face animation at the same time. The face animation is the one that is created during iOS runtime and is using the legacy animation system. So, what I want to do is convert the legacy animation to Mechanim with the AnimationClip.legacy = false; command and it works on Mac but not on iOS. Images are attached of the commands, but no errors are appearing. Is this supposed to work?

    pPtlhhM.png
    qNCwAnn.png

    Any suggestion how to resolve?

    Or are there different options how to create Mechnim animations during iOS runtime?

    Thanks!
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,555
    I don't think it's possible to create Mecanim clips at runtime and that wouldn't be true if you could just create legacy clips and change a flag so I wouldn't expect that to work.

    Are you sure you need to create clips at runtime? Could you create the clips in the editor and then just make sure the blend shapes use the correct names for the animations to control them?

    Otherwise you could always just script the blend shape controlling.
     
  3. Bartek_Gudowski_Friend_Factory

    Bartek_Gudowski_Friend_Factory

    Joined:
    Feb 18, 2019
    Posts:
    54
    Thank you!

    We are evaluating to convert all the Mecanim body animation clips to legacy animation system in the editor and see if it would work to combine them with blendshapes (using legacy animation system) during iOS runtime. We need to create the facial blendshapes during iOS runtime as we use the true depth camera of the Iphone X. But the other option to control the blendshapes through a script is also an alternative. If you have any more ideas we are very thankful.