Search Unity

Mocap Animation to Existing Skeleton

Discussion in 'Animation' started by Nukeape, Nov 16, 2019.

  1. Nukeape

    Nukeape

    Joined:
    Jul 23, 2019
    Posts:
    10
    I'll start off by saying that I'm new to using mocap in general, thus this might be very simple question for people to answer. I got an fbx file from a mocap lab near me for testing and want to add the animation to a custom 3d model. I can't figure out the best way to do it.

    The mocap fbx has opticals (I guess the point cloud of motion capture points), a skeleton and the animation.

    What I've tried:
    I Imported the 3D model and the mocap fbx to blender. There is a simple way to just riggify a model if you already have an skeleton. Sadly this did not work.
    I've also tried rigging the model, making sure to have the same amount of bones and naming them the same as the mocap skeleton. Then importing both to unity and adding the animation to the model. Thinking the animation should work if the bones where the same. This was not the case.

    Have any of you had any experience with this and/or have a better way to go about this?

    Thanks in advance!
     
  2. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    You are probably over-thinking it. Mecanim is designed to transfer the animation "generically" to any other Humanoid rig.

    So long as each Humanoid rig/anim is based off a T-pose, each can be set to Humanoid rigging (create from this avatar) <–– notice each is created from their own avatar setup, don't try to tell one to use another's avatar. That defeats the purpose of Mecanim.

    Mecanim should get the animation very close to the desired results, but it won't be perfect (due to things like arm/torso length, hip width, etc). Use the built-in IK (limbs) or tweak the anim keyframes to tweak.
     
  3. Nukeape

    Nukeape

    Joined:
    Jul 23, 2019
    Posts:
    10
    Thanks! I will fiddle around a bit with Mecanim and post if I make any progress!
     
    wetcircuit likes this.
  4. Nukeape

    Nukeape

    Joined:
    Jul 23, 2019
    Posts:
    10
    It turns out you where right, I was overthinking it. It was just a matter of rigging the model(I did it in blender) then I imported the model and the fbx with the mocap. Made an animator controller and put the animation in the animator controller... and it works. It just works (insert Todd Howard).
     
    wetcircuit likes this.
  5. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    235
    Could you please elaborate on this?

    I tried to follow your advise and it's not working (transition preview showing no animation, just a static avatar).

    What I did:

    1. Created rig in Blender (avatar A) and FBX imported it with the skin and animations to Unity, setting "creating avatar from this"
    2. Created another rig in Mixamo (avatar B) and FBX imported it just animations, setting "creating avator from this"

    Then I created controller, with avatar A and some animations from first import. Then I added to the controller animations from second import (with avatar B), created transition between animation A and B and it does not work.

    Both avatars are all green.

    What I am doing wrong?

    Thanks!
     
  6. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    is the figure stopped on a frame of your animation? (anim loads but doesn't play)

    or is the figure in a 'fetal' pose with knees/elbows bent, shoulders curved over and head tilted down? (no animation applied)
     
  7. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    235
    Yep, stopped on a frame.
     
  8. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Ok, that's a good sign :)
    I don't know what's gone wrong, but it's not the rigging or avatars, they seem to be good.

    it's probably a setting in your animation controller (and there are a few). I'd go over the docs here: https://docs.unity3d.com/Manual/class-AnimatorController.html
    Look for reasons the anim is stopped in a transition, or not looping
    (helps to run Unity while you check), it should be giving you some feedback about the play state of your animations.