Search Unity

Ignore animation properties at runtime (without AvatarMask?)

Discussion in 'Animation' started by AnnaThi, Mar 13, 2021.

  1. AnnaThi

    AnnaThi

    Joined:
    Dec 30, 2019
    Posts:
    1
    Hi,

    I'd like to know if there is any way to ignore, delete or disable some of the properties of an animation clip at runtime, similarly to what an AvatarMask does, to make animation works in a layered animation system.

    I'm working on a project that aims to provide an extensive mod support, which is why I can't use anything from the editor. All animations will be imported at runtime (thanks to Ricardo Reis' TriLib package), however most of animation import options are not made available at runtime by Unity. I can build an Avatar at runtime from my character rig, but I can't put it in the animation import settings, for example. This is why I must use Generic animations, with no avatar, instead of Humanoid ones.

    I tried setting up an AvatarMask using the Transforms method instead of the Humanoid method but it didn't work, the masked animation (which is in another layer) isn't playing.

    Another solution could be to export the animations with only the needed bones animated, but it's not possible for us right now (we use a Blender plugin that exports our animations into fbx and there's no such option). I tried to delete the unwanted properties using the Animation Window and it worked okay, the only problem again is that it's not possible to do that at runtime in the project.

    I'm using a plugin called Animancer for my animation system and layering in order to have more control at runtime, but I don't think there's any problem with it, as the whole system works perfectly when I use Avatars.

    Is there something that I'm missing here?