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

Generic vs Humanoid bizarre frame interpolation

Discussion in 'Animation' started by LaneFox, Dec 14, 2020.

  1. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462


    Generic on the left, Humanoid on the right. Timescale is 0.05.

    The issue is really clear, the arm basically rolls full circle on humanoid. The keyframes do not support this. The rotations are normal and no 3d program does this with the same FBX.

    The model is T-Pose enforced for import but there are a bunch of bones that are just completely nonsense with translation. This is a pretty simple example but I've also seen some crazy leg angles where the foot flies 2 meters away from it's keyframed position for no apparent reason on Humanoid while Generic looks great. There are no import warnings.

    Does anyone know why this is happening? I've adjusted everything I can think of and Mecanim Humanoid is just extremely determined to ruin the animations.
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Submitted a bug on this (1299627) with a repro project on 2020.2.

    I honestly can't find any reasonable explanation as to why this would happen, and since it's occurring on other animations/bones and cannot be reproduced in other 3d applications I can only assume the problem lies in the Humanoid remapping. I've changed everything I can think of to be adhering to what Mecanim wants and cannot find any documentation that suggests that this is even possible, so it has to be a bug unless someone can absolutely identify why it is happening.

    At this point there's no solution other than changing project spec to Generic - which is very non-trivial.
     
  3. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842

    . I see this happen a lot..... where Unity remapping screws up the rotations. I have done work for years with Maya, Motion Builder.. I some times had to use U motion to edit the animations on the fly since Unity screws them up.. if you have not got this fixed let me know i'M retired now... as far as contract work goes.... but if you have something I can look at, I can take a few to check it out.. I have seen you around on and off for years here on Unity. Also have you tried this on other versions of Unity like 2019.4? Just curious.


    I worked between engines for years, so a lot of the times, I had to adjust animations in Unity, and all other engines they are fine... So, if you don't have UMotion, I recommend to get it.

    PS: is this FK/IK rig??? and if so, did you set them up in Maya? the FK/IK, or IK rigs in Maya?


    Remember to, the Humanoid rig has its own built-in constraints... Which I always hated... It will over ride ones you add.. a lot of the times. This looks to be messing with those constraints. They seem to be ignored completely. I bet this is a remapping issue from the Humanoid rig...... You can load your own mapping, and don't let Unity remap them... you can your self with a text file.
     
    Last edited: Mar 27, 2021
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Sorry I missed this reply.

    The rig was done with Advanced Skeleton and uses both IK/FK. The legs are mostly animated with IK, I think. I tried to hire a few people to fix it but they just poked around at it and didn't want to deal with trying to fix. Maya to Unity with issues like this are apparently really technical and most animators I have access to online don't know enough to bridge the gap and are even less interested in fixing someone else's work... so I couldn't find anyone to fix them. I did get some decent feedback on why it may be happening. Original author had a film background, and not a lot of game engine experience.

    Possible causes:
    • Rotations on axi that Unity does not read and discards, which leads to very unexpected results since there are big gaps in data. However, I see artifacts in Generic as well, which shouldn't be the case.
    • Export settings could be incorrect. (not forced euler?)
    • Unity doesn't document nuances of how it may be interpreting the data. Especially for Humanoid. (such as first item)
    Unity support said they fixed it in motion builder (i did not get to see the results) but I would *really* prefer it fixed in Maya. At this point though, I don't even care. I just need the animations to not be broken.

    @Recon03 if you are interested in taking a look I still need the problem resolved.
     
  5. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842

    yes possible causes is right on the money typically , I worked in the gaming industry over 28 years, but just retired from working as a contractor or clients anymore as I was saying. but I seen you around, and seem like a good guy, who really needed some help, so I thought if you needed I could take a peek.

    So those possible causes are common issues in Unity.

    I also use Advance Skeleton. I own Maya 2016. and Modo 15. I tend to use both for different reasons.

    Unity Humanoid, export is a nightmare, and loves to screw up imported rigs. This is why so many use Generic. I have used both, since Unity 2, 3. since they existed, so they can be challenging. I tend to adjust animations using U-Motion a lot since you have real time, in Unity.... when I use the same rigs , in Unreal, Unigine and others, they are normally fine.. So this is related to Unity, I have no doubt. Its related to Euler export, issue.... Also naming, conventions is also a common issue, which is why I have a set up that automatic keep names, consistent across the board.

    But my experience is related to game engines for sure. I have been a Tools, designer for a few larger companies as well.

    I won't make promises, but I would be happy to take a peek if you need it.


    Why did Unity support , need it fixed in Motion Builder? I own and use Motion Builder as well..... This is NOT a must, so not sure why they said that...


    PS : if you want, me to look at it, be sure to include the Unity file, so I can see the issue.. and the Maya files.. as well..Not just the FBX, but the actually Maya Files...

    if you need me to sign something saying I won't use your files, I would be happy to do so...( I understand, you don't know me...)


    also what may need to happen, is I may need to remap, and load them through a text file, so Unity does not over ride the settings from Maya. .. You would need to be ok with what ever I do to get this fixed..

    if you have some thing you really don't want, please tell me ahead of time.. You want this to work for Humanoid.....rig only right? Just to be clear.
     
    Last edited: Apr 13, 2021
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    In case anyone else wanders across this problem.... Sorted this out (pretty easily, actually) using UMotion to edit the FBX files. This was something to do with a mix of inter-frame interpolation and IK targets. The IK targets were completely off target, despite looking fine in Maya. Some animation had to be re-keyed because the interpolation was rolling the joints.

    The interpolation issue does not seem to have any resolution, you just have to make animations and if they go nuts in Unity then deal with it after the fact. I recommend a workflow that separates the animations as much as possible so this doesn't affect other animations in the same timeline. You will have significantly less issue with Generic, the Humanoid remap seems to make any mild or theoretical problems become drastically worse.

    Just to reiterate - my finding is that this can't be fixed in the source files because nothing is wrong with them, the fbx plays back fine in other 3d applications - you have to change the FBX inside Unity (UMotion), or use MotionBuilder to modify it.
     
  7. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842
    Well one issue I seen in your files, was who ever named them, where using a plug in, which can cause issues, if naming of IK, roots, etc are not proper. It was not able to find the naming conventions for IK, at all....

    Using Umotion, Motion Builder, as I shown you was a good work around. for Unity.

    But, you still can use with out, if its set up when naming conventions are matched. and some plug ins can cause conflicts with in Unity. that will destroy the IK targets...

    I used Humanoid and make sure when I set up FK/IK, I make sure all my naming conventions match perfectly. ( Unity is a bit touchy, I still sometimes still see some animations off, which is why Umotion is nice .

    Umotion is a fantastic tool, for Unity.... I wish Unity would get its head out of its arse and make a better importing system from Maya, Modo..for animations.

    Also sometimes it depend if someone was baking the animations as well.... The set up for Unity and IK, are so damn picky..


    Soon as I imported to UMotion that also has issues with finding your IK targets.

    https://docs.unity3d.com/Manual/ConfiguringtheAvatar.html#AvatarSetup


    Mapping is important and setting up T-pose in Maya was critical any time I had got it to work.

    But ya I recommended Umotion to you, as that is a life saver when using Unity.... Now a days I wouldn't use Unity with out it... Since Unity importing tools are so bad...


    The source is not an issue, besides the naming from Maya to Unity, need to be match perfectly. Also don't let Unity reconfig anything..... That is important for Humanoid.

    Regardless, there are so many work arounds, the best I found which is why I shared with you was UMotion.

    Source files are rarely an issue, because they work fine in other game engines, Unity does a terrible job of importing FK/IK... The Importing is the issue from Maya to Unity...



    This is normally the issue and how a person imports.


    Unity should take note from UMotion.....period.
     
    Last edited: May 3, 2021
  8. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    Thanks for spelling out the major issue here. Unity aint so unified. In fact its uber clustered. But I will stop right there because my wrath exceeds my online access priviledges. Explitives inserted here. Sorry ass programming if I ever experienced it any where. Oh look a great asset! Days, weeks, months, years in the dark abyss of unproductivity, FUP dis!
    There is a disconnect between the hierarchy transforms, the animator and the Muscle and settings variables/properties. You go in with a static fbx humanoid model t -posed and go to muscle settings. The model crouches. Where did that come from? You correct and they dot save. Like NOT DONE button press. You go to animations. Model is posed correctly. You press preview of play the the model crouches. Wait what? I just fixed that mess. And you spend days trying to find where the transforms changed. I pull in the rootmotion HumanIdle and viola the model stays static with its clips running. Great. You make a copy of the anim and delete all properties. Now you get limp foot, crouching tiger or shifty shifter. Oh look another undocumented feature. I guess I will change the game play to just throw spaghetti against the wall since my human is now a mangled glob some where else in the scene. I got to get another life. What do you do for a living? Oh I am a game developer. Thats too bad. Fell for the promise did ya?
    I have Umodeler.
    #changemymind.
     
    Last edited: May 7, 2021
    Recon03 likes this.
  9. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842

    Ya I will tell you the same thing, I have used Unity for over 15 years I also been animating for many years now in Maya, Motion Cap and other forms.... Sadly Unity importer is terrible and breaks IK's a lot among other things, depending on how its imported.

    The best way, as I suggested to Lane when I first helped him was to use Motion Builder ( I know not everyone has.) but Umotion inside Unity has been a god send, you can retarget the IK, or make a new one. Set up the bones that get out of wack... from the importer./ You can do this less than 10 mins, sometimes faster. Yes I know another asset.. This is why I use Unreal for most professional work...I don't run into these stupid issues. So I have a love and hate with Unity too..believe me..

    But get UMOTION, these issues will be resolved... ask Lane.) he will confirm his issue I was able to fix his upper issues rather fast. Then he took it from there and fixed all of his stuff. doing the same thing .


    PS Unity import can work, but its DAMN picky with its naming, for IK and how you import it.... So, as I always tell people, don't expect it to work.... its kinda a flip the coin type thing......and if you get one thing wrong, your screwed...the issue Unity importer, basically takes over the IK, and screws them all up. Most of the time it can't find them...

    In maya a lot of the times we use plug ins.. which I seen some can cause issues. ( not sure why other than how things are named, since Unity, needs a transform for every bone....OTHER ENGINES don't..

    when I would Mentor people with UNREAL, they would scream where is MY TRANSFORM!!! its funny to watch... They are so used to that trash... Every other engine I ever used does not need that transform for every damn bone as Unity does... Same with Camera and other objects... Something that has been a quirk for Unity for ever..which is half -ass if you ask me..
     
  10. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    @Recon03 I will check out Umotion. Thanks for the reverb on my angst here. My thinking was once some one figures out what they want to do they bail, hide and dont bother giving any instructions to others.
    I dont want to know their work. I just needed affirmation of my darkness.
    I will report my Umotion efforts back here.
    I had been reporting on another thread to Unity but no answer. Either they cant touch that or not their problem or no answer. I believe your answers here have addressed this. Thanks again.
    There are too many magic word strippers in Unity. You know the type. They show results then only show part of the solution. Eh, eh, eh... You didn't say the magic word! And usually you get this when you need an answer the most, in the middle of a headache.
    Yes I just spent a year between Wings3d, Blender, and Unity with FBXs. I achieved wonderful results until I go halfway into Unity Rigging. I post this so anybody else that comes along will see that that they are not alone and their pain is felt.
    Its a helluva way to be included. I am looking forward to my root canal today after all this.

    I just bought Umotion Pro. I read the reviews and that solved the problem. If it falls short in any way in my workflow I am sure Petre has a solution. But by far it surpasses any brokenness of UnityAnimrig.
    If I could have known Unityanimrig was so broken I would have sprung for the asset price of $60.
    This is a godsend. I will be further along in an hour than the lest 3 months I spent with Unity animations. Petre has layered forward and reverse IK manipulations live inside animations. OMG are you kidding me? This smokes any Unity's attempts. I am gonna make some progress now. One can not simply know the delusions until one steps into the problem.
    Nobody buys Umotion upfront. #changemymind. This is a tool from experience.
    This is a gamechanger and will correct my workflow back onto my work.

    And this looks like I can rig my own meshes coming in!
     
    Last edited: May 11, 2021
    Recon03 likes this.
  11. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I got work to do:
    upload_2021-5-11_12-11-8.png
     
  12. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842

    Yes sir I know the type and we have a name for those people.. but I won't repeat it, I will be nice. ( today about them)

    anyways, glad Umotion did the job I knew it would, I been using Unity for to long and know the battles..

    EVEN though i'm retired, I still try and help folks if I see someone struggling... people should be willing to help one another in need... Why be a jerk and ignore someone if you know the answer or have the experience, I never understood people who just want to be a jackass, and just ignore someone or, they are just jerks all around.. like you have to beg for help, so I always have tried to help people.. in Unreal, Unity and other engines I worked with over a long career... I know some people feel threaten if they help someone advance through an issue.... They are scared if they help someone, that they may be better than them, or make something better...

    To me, that is all NONSENSE, so, at the end of the day, its better to help someone if they need help and are respectful when asking. ( believe me I try to help folks and still come across people, that are still jerks even though I helped them..DISCORD is full of idiots like that .. lol. Which is why I don't use it anymore since I retired. anyways, glad it worked out.

    Have fun with UMOTION and your project.!