Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bone Retargetting with real-time animation

Discussion in 'Animation' started by silentslack, Jul 15, 2015.

  1. silentslack

    silentslack

    Joined:
    Apr 5, 2013
    Posts:
    379
    Hi,

    I'm working with real-time motion capture data in Unity and I would like to apply this data across many different characters in the same way that mechanim does with Animation Clips and the Mechanim Avatar. (The mocap data is an array of rotations that right now I'm simply applying to a character's bone transform directly - lots of foot sliding and other nastiness across characters of different sizes and shapes.)

    There is no problem baking the mocap data to an FBX and then applying to different character avatars but I would like this to work in real-time.

    I would like to know if this is currently possible? I have attempted to dynamically create an animation clip from the mocap data any then apply to an avatar but hit a wall (couldn't set the dynamically created clip to be of Rig Type Human in code). From what I can see all of the bone retargeting magic of mechanim is restricted to AnimationClips and hidden away from tinkering.

    If it is not possible, is this likely to change or would my only option be to write a bone retargeting layer myself?

    Many thanks for any input into this! Jake
     
  2. bteitler

    bteitler

    Joined:
    May 11, 2014
    Posts:
    52
    I have the exact same request. I have a bunch of BVH files I'm trying to stream in real time and re-target to characters that have local bone orientations in the bind pose that aren't consistent. Since the joint rotations in the Unity scene don't seem to be aligned, clearly the retargetting is handled elsewhere.

    Is there some way I could modify the mesh to align the the local bind pose joint orientations with Unity's global axis?