Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

RemapToRootMatrix wrong in animation 0.8.0?

Discussion in 'Animation Previews' started by snacktime, Nov 3, 2020.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    This is strange because it actually broke post upgrading entities but pre upgrading animation. I only did one run without upgrading animation. But with it all upgraded problem remained and the remapping here is what sticks out after comparing my setup to the latest samples 'my first controller'.

    The problem is the rig root entity isn't getting it's LocalToWorld updated, so neither are the rendermesh children and everything renders at origin.

    I noticed two differences between samples and my entities.

    - RemapToRootMatrix is not updated the same way. t doesn't reflect the difference between the rig and rig root on my entities.

    - Samples have ProcessLateAnimationGraph_WriteTransformHandle. Mine do not.

    Otherwise the rig and rig roots look identical, outside of the specific controller components.

    But it's also strange that this broke on my before updating animation. Really difficult to debug animation because of the interplay between entities, animation, and HR. So hopefully the above offers a clue I'm missing.

    Edit: AnimatedLocalToWorld on the rig is also wrong. In the same way not reflecting the difference between rig/rig root.
     
    Last edited: Nov 3, 2020
  2. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    did you add a LateAnimationGraphWriteTransformHandle to the root/hips gameobject for your rigged entity? there is also a DefaultAnimationGraphWriteTransformHandle.
    I noticed the samples docs seem to refer to 0.4.x as the name conventions are mostly/all refer to before a bunch of systems were renamed and the occasional deprecated thing here and there, like referring to a RootMotionNode, which was refactored out of existence.
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    I didn't but I'm not using root motion, so as far as I know I shouldn't need a write handle component. Although I might just add it for now to get stuff working.
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    So looking at UpdateRootRemapMatrixJob it appears that is where the remap is set. It appears to be working correctly. But something is writing the rig root LTP every frame without the correct offset. What I have no idea yet.
     
  5. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ok this actually seems to be some strange issue with Entities and transform hierarchy on our game project. Using the animation samples project which has the same Unity version and same DOTS packages, child transforms update correctly. On our game project the child LocalToWorld is never updated.

    Test was an empty scene and a cube having a child cube and ConvertToEntity on the parent. Really strange.

    Edit: bad stable hashes in entities, silently breaking systems somehow. Animation is not the problem.
     
    Last edited: Nov 4, 2020