Search Unity

Kinematica: No sequence matching the query were found in the binary

Discussion in 'Animation Previews' started by peaj_metric, Jun 9, 2020.

  1. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    I am trying to use Kinematic with a custom animation set.
    The only thing I get so far is this error:
    "Exception: Error in ReduceTask : no sequence matching the query were found in the binary"

    I was building on the Biped example with a custom animation set similar to the one from the example.
    I tagged all of the animations with the BipedLocomotion.Locomotion tag and the Idles additionally with the BipadLocomotion.Idle Tag.

    There should be enough animations to query from although all of it is uncleaned Mocap data.
    Is there any way to debug this?
     
  2. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Hello,

    This error means there is no valid tag provided in the argument of PushConstrained() function. By valid, I mean the tag should be associated to a metric.

    Can you check in the Kinematica Asset Builder window that for each LocomotionTag you can see the associated metric in the Metrics bar ? (like the metric named "Default" in the example below)

    upload_2020-6-9_16-34-21.png
     

    Attached Files:

  3. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    My bad. Seems like I accidentally had the wrong Locaomotion Tag selected (HelloWorld.Locomotion instead of Biped.Locomotion). So there where no metrics showing up.
    It would be really handy to be able to not only bulk add but also bulk remove tags btw.

    But I encountered another problem:
    Animationclips added to the Asset Builder have a wrong length.
    It does somehow depend on the Animation settings.
    So my animation clip which is actually 38.111s ends up being cut to 29.63s when Animation compression is enabled.
    As animation compression is disabled in the example files I disabled it and now the same animation is 114.33s long in the Asset builder.
    upload_2020-6-10_11-56-44.png
    Which means it is actually still only 38s of animation with no movement after that.
    This does not happen with the example animations however.

    Is this a bug or do I have to change a specific setting somewehere?
    The animations are in 24FPS btw. I also tried to change the samplerate to 24 to try if this changes anything. It didnt help.
     
  4. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    There is probably an issue with compressed animations in Kinematica, we will need to have a look. However, you probably should not enable compression on your animations since compression is lossy and anyway Kinematica will store uncompressed poses in the binary (Kinematica will use its own compression later).

    I am still curious about why the clip duration shown in the builder is about twice as long as the real clip duration. I notice you seems to have added twice the same clip in the builder, is it true ? if yes that might explain the issue.
     
  5. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    I added it twice to see if the same clip will get two different length depending on its import settings at the time it is added.
    And yes it does:
    upload_2020-6-11_14-30-18.png
    The first one is the one without compression.
    No matter how often or in which order the clip will be added it will always end up being 29s without compression and 114s with compression.
    The only real difference I can find between the example animations and ours seems to be the framerate of 24FPS.
    Maybe there is something wrong with resampling the animations?
     
  6. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Ok, would it be possible to DM me this animation (or animation that you have this issue with) by any chance (if it's not secret material of course) ?
     
  7. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Ok, this is indeed an issue in our code, I will fix it in the next release of Kinematica. Meanwhile, you can fix it locally by remplacing the function ComputeAccurateClipDuration in Editor\Utilities\Utility.cs of Kinematica package by this one :

    Sorry for the inconvenience !

    Code (CSharp):
    1.         // Unity AnimationClip can have inaccurate length when the clip is pretty long (noticeable for clip > 5 mins)
    2.         internal static float ComputeAccurateClipDuration(AnimationClip clip)
    3.         {
    4.             ModelImporter modelImporter = ModelImporter.GetAtPath(AssetDatabase.GetAssetPath(clip)) as ModelImporter;
    5.             if (modelImporter.animationCompression != ModelImporterAnimationCompression.Off)
    6.             {
    7.                 Debug.Log($"Animation clip {AssetDatabase.GetAssetPath(clip)} has compression enabled, it's better to not use animation compression since it's lossy and Kinematica will uncompress animations anyway.");
    8.                 return clip.length;
    9.             }
    10.  
    11.             var bindings = AnimationUtility.GetCurveBindings(clip);
    12.  
    13.             float frameDeltaTime = 1.0f / clip.frameRate;
    14.  
    15.             int maxNumKeys = 0;
    16.             foreach (EditorCurveBinding binding in bindings)
    17.             {
    18.                 AnimationCurve curve = AnimationUtility.GetEditorCurve(clip, binding);
    19.                 int numKeys = curve.keys.Length;
    20.  
    21.                 if (numKeys > 1)
    22.                 {
    23.                     float firstDeltaTime = curve.keys[1].value - curve.keys[0].value;
    24.                     if (!Unity.Mathematics.Missing.equalEps(firstDeltaTime, frameDeltaTime, 1e-4f))
    25.                     {
    26.                         continue;
    27.                     }
    28.                 }
    29.  
    30.                 maxNumKeys = Mathf.Max(numKeys, maxNumKeys);
    31.             }
    32.  
    33.             int numFrames = maxNumKeys - 1;
    34.             if (numFrames <= 0)
    35.             {
    36.                 return clip.length;
    37.             }
    38.  
    39.             return numFrames / clip.frameRate;
    40.         }
     
    florianhanke likes this.
  8. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    Great thanks for the quick fix!
     
  9. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    I am sry to bug you again. The animation length is correct now but the character does not do anything other than idle.
    I put him in the Biped example scene with the same scripts as the example character, but he does not move.
    Could that be connected to the uncleaned data somehow? E.g. the offset to the characters root.
     
  10. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Hello, when you try to preview your animation with Kinematica Asset Builder window, can you confirm you see a correct trajectory like the example below ?

    upload_2020-6-15_9-13-41.png

    You should see past and future trajectory from character root
     
  11. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    It does not show a trajectory indeed. The arrow is stuck at the root.
    upload_2020-6-15_16-18-35.png
    The character avatar is defined to have the hip/pelvis bone as the root though:
    upload_2020-6-15_16-20-55.png
    Do we have to edit the animations so the root transform will move with the character?
     
  12. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    I just figured out that I may have to change the root node in the animations:
    upload_2020-6-15_16-38-25.png
    That leads to some motion in the trajectories, but still doesnt look correct:
    upload_2020-6-15_16-39-20.png
     
  13. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Unfortunately the issue is due to Kinematica currently not supporting hierarchies where the first body joint (Pelvis_def) is not the first direct child of character root (HalfStep_straight_01_01).

    upload_2020-6-15_13-24-35.png

    Sorry about that, we should have made it explicit, and we will remove that limitation in the near future. Meanwhile you can fix that by either changing the hierarchy of your character in your FBX by making sure Pelvis_def is the first child :
    upload_2020-6-15_13-30-24.png

    Or your can change bodyJointIndex to 3 in AnimationRig.cs line 27

    Sorry for the inconvenience !
     
  14. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    We changed the hierarchy and reexported the animations.
    Unfortunately it turned out to be more complicated than that.

    We tried to mimik the example files as closely as possible:

    Although the root is not the parent of the hierarchy it still has to have rootmotion.
    It seems like Kinematica takes the rootmotion from the bone marked as root on the animation files (Root)
    We tried to use the hip bone. This turns the character on his face though as the bone is not aligned with world space.
    kinematica_flipped.png

    So we projected the hips to the ground plane in order to get a root bone the mimiks the behaviour of the example root.

    Interestingly the root motion seems to be applied twice to the root bone which causes it to move around erratically in the examples. I guess this can just be ignored if the root bone is not part of the skeleton hierarchy.
    kinematica_root.png

    Even though we tried to copy the example setup as closely as possible it still doesnt work correctly.

    The trajactory is now calculated and displayed correctly but in contrast to the example character our character seems to be attached to the root node and thus has the same erritacal behaviour as the root:
    kinematica_bug.png
     
  15. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Hello, sorry for the trouble you have, would mind sending me in DM you newly configured rig please ?
     
  16. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    Just got your latest rig, it's better but an issue remains actually :
    upload_2020-6-24_11-22-15.png

    The Pelvis joint is the second child whereas it should be the first (maybe you can rename LibraryDude_mesh as I think joints are sorted by alphabetical order)

    Sorry for the inconvenience
     

    Attached Files:

    Last edited: Jun 24, 2020
  17. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
    We will fix that for next drop of Kinematica which will be released soon. This drop should be able to pick the right root joint you setup in your Avatar without needing any specific organisation of your joints. I tried it with your rig and it seems to works as expected :

    upload_2020-6-24_12-12-17.png
     
    florianhanke likes this.
  18. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    68
    It finally works.
    I misunderstood it the first time and thought the pelvis just needs to be a direct child of the character root.
    Maybe it was just from my experience that the order of child objects usually doesnt matter in Unity.

    We changed the order in the fbx file.
    The alphanumerical sorting is weird but fortunately it can be disabled in the import settings.

    Thanks for your patience!
    Looking forward to the Kinematica update.
     
  19. FrancoisFournel

    FrancoisFournel

    Unity Technologies

    Joined:
    Feb 12, 2020
    Posts:
    64
unityunity