Search Unity

How are the Rig Component and Bone Renderer Component transforms populated?

Discussion in 'Graphics for ECS' started by HeyZoos, May 6, 2020.

  1. HeyZoos

    HeyZoos

    Joined:
    Jul 31, 2016
    Posts:
    50
    upload_2020-5-6_15-57-26.png
    upload_2020-5-6_15-56-4.png

    Is it done manually? There's hundreds of transforms on the prefab. What determines if one transform is referenced by Bone Renderer Component or Rig Component?
     
  2. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    I just used to drag'n'drop the entire bone structure in there. I'm hoping that eventually the tooling will handle that for us.
     
  3. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    Bit of a tangent but still animation related, given you seem to have had more success with the package than most here - have you been using humanoid rigs successfully? I've tried a little bit but couldn't get them to work, not with my own or with unity's "Ethan" character, which perplexes me as the terraformer is set as a humanoid rig.
     
  4. HeyZoos

    HeyZoos

    Joined:
    Jul 31, 2016
    Posts:
    50
    How do you know what to drag over? Each component uses a different subset of the transforms
     
  5. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    I've only gotten it to work with `Generic` characters, as well I had to check `Resample Curves` on the animation import, otherwise it would just not work.

    Gut feeling is that it might not be the universal solution, but just work for me and the specific models I use. I'm no animation expert :rolleyes:
     
  6. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Well you attach those components (btw
    BoneRenderer
    is really only for debugging) to the root of a gameobject (i.e. a prefab) that ends up getting converted to an Entity. Some Component/ConversionSystem picks it up along the way and does its ECS magic. So just drop all the bones of the model in there to be safe. I never tested if you can get away with only select bones (say you don't need to have finger bones update, because the camera is too far away to see it anyway).
     
  7. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    An animation has bones baked into it. For DOTS you need generic animations. Humanoid is a completely different format that DOTS can't read.

    Your character model has bones.

    Animation and character may or may not use the same model/bones.

    If not that's where you have to remap. Which is both a conversion time thing to create the remapping and then a graph thing also where it remaps the animation based on the remapping you define. Remapping is a different thing then the rig component.

    Simplest is to use humanoids for creating the mapping, due to Unity has tools to read the bone information and make mapping easier.

    This is what a rig remap setup looks like for us:
    upload_2020-5-6_23-58-40.png


    Then we have an SO of animations each linked to a remap:
    upload_2020-5-6_23-59-37.png


    So we have humanoid versions animations and models for remapping. Then we dup the animations to have a generic copy which is what we use in the animation config.

    And then our actual animator component which has a RigComponent attached.

    And then of course all the conversion logic and systems/graphs.

    Creating a good amount of tooling I would say is required.

    You need to be selective about character models and animations. You can't just throw anything in like you can with mecanim. Most animations you can buy for example are not in correct tpose. Worse some don't have a reference model and provide a different model for each animation. Mecanim is really good at correcting for all sorts of crap people throw at it, which has basically resulted in a lot of crap.