Search Unity

Character mesh deforms incorrectly when altering the transform of the bones directly

Discussion in 'Animation' started by Elkis, Feb 21, 2017.

  1. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    87
    Hello! I got a bunch of positions and rotations for each bone of a humanoid character and would like to use them to deform a humanoid mesh.

    Here are the positions and rotations in T-pose correctly displayed on Unity:



    But when applying them to their corresponding character bones, it deforms weirdly:



    Is there something I am missing?

    Thank you!
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Need more info to help. Just from reading what you wrote, it sounds like maybe you are trying something unconventional with a character rig/model? Are you going through the regular import, setup character/avatar/animation process?
    Because how this would normally be described - I have a character rigged and imported into Unity, instead of a bunch of pos and rot for each bone of a humanoid.
    And because this would normally be described - when I import him and play the animations he deforms weirdly, instead of when applying them to there corresponding character bones.
    Are you talking about animation retargeting here?

    Additional information will help.
     
  3. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    87
    Thank you for your response! I apologize for not providing enough information.

    I have a CSV file that contains an animation of a humanoid character, it is represented as a bunch of positions and rotations for each bone of a humanoid skeleton for a certain amount of frames. I got this data from a mo-cap software.

    I was trying to update the Transforms of each of the skeleton's bones during runtime and expecting the mesh to deform as it would do in a 3D modeling software after you have rigged the character.

    After googling for long time, I came upon this question and learned that I needed first to create a HumanPoseHandler and had to set a new HumanPose every time I updated the position of the bones.

    Although I still don't fully understand the process nor the reasons behind it, it is now working flawlessly :)

    Thank you.
     
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Huh!
    Seems a bit in-depth to create a rig from a motion file. Hopefully it doesn't cause optimization issues later down the pipe.

    Glad you found a solution.

    Another process for future reference - if needed - you can import csv data onto a standard biped in 3D Max. Mimic the humanoid rig in Unity by unchecking triangle pelvis and checking triangle clavicle under motion panel in biped structure, then that rig can be exported/imported directly into Unity as a standard humanoid rig. About a 3-5 minute process. ;)