Search Unity

Animation Documentation

Discussion in 'Data Oriented Technology Stack' started by JakHussain, Jan 30, 2020.

  1. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    155
    I'm messing around with the DOTS sample and I'm finding it pretty difficult to get a grasp of what's really going on with animation without any documentation to speak of. At least with the net code I have something to refer to.

    Is there any ETA on when any basic manuals are going to be written for the animation package?

    Also, I think choosing to name the package as simply "Animation" is a pretty poor choice since it doesn't convey that it's for DOTS only and I expect this would confuse a lot of people once it's visible in the package manager by default.
     
    Mikael-H likes this.
  2. andreicfsteaua

    andreicfsteaua

    Joined:
    Nov 18, 2019
    Posts:
    5
    I am in the same spot as you, desperate for Animations in Pure ECS but so far I've seen just 2D animations in Hybrid ECS and the sample is too hard for me to understand yet. Maybe just learn basic animations and then learn the new ones from the sample or wait for the final iteration of the Animation Package
     
  3. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    42
    SergeyRomanko and awesomedata like this.
  4. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    I'm also facing same issue. Sample is really hard to understand. I'm messing with DOTS Sample and FPS Sample for many days. But I couldn't figure out how animations are working.
    I'm also developing Third Person Shooter game with DOTS I couldn't understand how to run proper rigged animation.

    I also watched this https://github.com/Unity-Technologies/Unity.Animation.Samples new animation package. But I couldn't understand how to implement it in DOTS or documentation is not clear for intermediate developers.
     
  5. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    35
    I've been playing around with the
    unity.animation
    package for a while ( https://github.com/Unity-Technologies/Unity.Animation.Samples/issues/1#issuecomment-576544306 ) and got it to work with URP (officially only HDRP is supported right now). Drop
    0.3.0-preview.7
    made things a little more performant and the guys/gals are working hard for official URP compatibility for GDC in about a month.

    To get started I recommend checking out this example:
    https://github.com/Unity-Technologi...s/Assets/Scenes/Examples/MyFirstAnimationClip
    Drop in a model of your own and compare it to the prefab/rig/etc... that's used by that example. Follow the scene dependencies, check out the shader graph, inspect the prefab (it has some components,
    RigComponent
    (iirc) in it).

    Disclaimer, it's not yet a drop in replacement to the old animations! There is some ground work to do rn, i.e. use a specific shader, add a component to your prefab, add all bones from the rig to the model. It's doable if you really need it, but I'd rather wait until the integration is simplified. I'm very confident that they'll come up with more "convenience classes" that make this a breeze. So far I'm treating it a performance proof of concept for my game until it's more "final" :)

    FYI: Performance wise I can get 400 models (≈1M tris total, unlit, no shadows) to animate on Android. 40 FPS on a Pixel XL (3.5year old flagship phone) and >90 FPS on a Pixel 4 XL (current flagship phone):
    74304866-11688000-4d13-11ea-9d7b-a45ad68154bc.png 74304870-12011680-4d13-11ea-8345-273f62dd4e65.png
     
  6. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    I downloaded a character and an animation from mixamo, follow example scene's instructions carefully. But my character is not running animation. BoneRendererComponent shows character's bones are in animation's starting state (but animation is not playing) and actually character is in T Pose. As you can see in following image.
    animation rig.PNG
    There is no error in console log, although there are some warnings. animation logs.PNG

    I didn't found SceneIDMap game object in scene and also in character.
     
  7. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    35
    Hm, there should be 2 components on your prefab where you reference all bone transforms. Looks like you might have done that for only one of them?
     
  8. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    626
    Are you using a shader graph that has the Linear Blend Skinning node in it (or an equivalent handmade shader that uses the _SkinMatrices buffer)?
     
  9. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    35
    I'm using a very simple Shader Graph modeled after the HDRP one from the github project.

    73720230-53bc0c80-46d6-11ea-8bf9-6c77b91557d5.png

    (Sidenote: Is "PBR Master" the default "lit" shader master node in URP? (I'm pretty new to shaders and was wondering what the most efficient master node would be or if the compiler strips away all the unused stuff automatically :rolleyes:?)
     
  10. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    I already added both RigComponent and BoneRenderComponenet on character prefab and passes all bones' transforms to it.
    animation rig highlighted.PNG
    And on skin of character I also already added SkinnedMesh.
    animation skin.PNG
    But animation is not running. Instead in play mode bones are in animation's starting pose and character is in T-Pose (As you can see in the reference image which I posted in previous reply.)
     
  11. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    35
    Is the
    Beta_Joints_MAT
    using the shader graph I posted above?
     
  12. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    No, I'm not using any shader graph. It is unity's default HDRP converted shader
    HDRP/Lit
     
  13. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    35
    That's your issue, you material uses a specific shader that takes "bones" into account via the LinearBlendSkinning node :)
     
    JakHussain likes this.
  14. farhanulhaq_teraception

    farhanulhaq_teraception

    Joined:
    Jan 2, 2019
    Posts:
    10
    Thank you very much. Now animation is running fine.

    I have few more questions about new animation pack.
    1. Animation on character runs when character is generic (In FBX settings), Animation is not running when character is Humanoid. Is animation only run when character is generic or I'm missing something more?
    2. When we can able to use unity's old animator component in dots? Or Unity is planing to change it?
     
unityunity