Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Creating new animations with animation rigging using the animation window

Discussion in 'Animation Rigging' started by SpiccyMayonnaise, Apr 23, 2020.

  1. SpiccyMayonnaise

    SpiccyMayonnaise

    Joined:
    May 10, 2018
    Posts:
    22
    Hi all,

    So I have been messing about with the animation rigging package for a little while now, and I have come across something really annoying. I'm not sure if it is directly related to the package, but I assume that others here have run into the same problem I have.
    upload_2020-4-23_23-28-46.png
    Whenever I have certain animation clips previewed on my character using the animation window, he sinks into the ground. This particular clip only has keyframes for animating the constraints, none of it animates the character directly.

    Do I need to have all of my clips animate the character as well as the constraints, or is there something that I'm missing here? This has really been holding me back when trying to make new animation clips for my character, which is disappointing because the workflow for animating via just the constraints is much easier than editing full-character animation clips.

    I should also mention that this is with a humanoid rig, and that I don't get this problem at runtime, because I layer this clip on top of other clips that animate the character. This is just a problem that I have in edit mode when previewing and recording. I know that this pose is the humanoid test pose, but I'm not sure how I can just get my character to show a regular pose or one of my other animations, outside of just combining the clips together somehow.
     
  2. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Hi,

    The animator does reset a character to 0 (all the bones to 0 in muscles space like you see in the muscle window).
    The root is reset to the default center of mass.

    They do all that to be able to transfer the animation from one character to another using the muscle space instead of the regular quaternion space of the bones.

    https://answers.unity.com/questions/528691/how-can-i-set-a-default-pose-for-my-character.html

    https://forum.unity.com/threads/reset-to-t-pose.397760/

    https://answers.unity.com/questions/351650/how-do-i-force-my-character-to-a-certain-pose-t-po.html

    Definitely not intuitive since nobody would expect their character to move into a crouch position but that's what happens with the Animator when the avatar is humanoid but you can probably find a solution in the threads I shared.

    Cheers,
     
  3. SpiccyMayonnaise

    SpiccyMayonnaise

    Joined:
    May 10, 2018
    Posts:
    22
    Thanks for your reply,

    I looked at those threads you shared, but none of them seemed to address the problem that I'm having. I know how to give my character a default pose in the editor when I'm not playing any animation on it. The problem is when I use the animation window to preview an animation clip that has no humanoid data, I get the pose shown in the screenshot. Is there any way of getting my animation clips to not reset the character to this zero pose? I have already tried turning off "write defaults", which changed nothing.
     
  4. SpiccyMayonnaise

    SpiccyMayonnaise

    Joined:
    May 10, 2018
    Posts:
    22
    For anyone with the same issue, my workaround is to create a copy of your character with a generic rig. Make sure the copy has the same Animation Rigging rig setup on it. You are free to make animation clips on this copy and have them transfer to your humanoid character because Unity animation clips use weak referencing.

    This seems like a big oversight in the humanoid system, it should be possible to author generic clips that don't interfere with the humanoid structure.
     
  5. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi,

    Unfortunately, humanoid was never built to author clips, and while default values for humanoid make sense in a runtime setup (the relaxed pose defines a sane character setup to be used for arms and legs IK), it doesn't really make for a user friendly authoring setup.

    Indeed, copying keyframes from an existing clip to your newly clip should work. Be aware however that ultimately, you'll be creating a retargetable clip with non retargetable data (namely animation rigging constraints).

    You can also layer your animation rigging contraints on top of the existing humanoid animation (You can look at the SIGGRAPH 2019 workshop where we do that in the state machine, albeit for generic data). You can also use Timeline if you're looking for an authoring tool where you can preview the result live (Unity 2019.3 and above). You can create an override layer on a base humanoid animation layer where you can author a clip to animate your character constraints.
     
    hawaiian_lasagne likes this.