Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Rigify to Mecanim failure

Discussion in 'Editor & General Support' started by Mehd, Feb 21, 2018.

  1. Mehd

    Mehd

    Joined:
    Apr 29, 2016
    Posts:
    91
    Hello, I've been trying to import a Blender rig to Unity in order to then have the possibility to retarget my animations to other characters. Here's what I've done:

    1. Added a basic meta-rig, removed breast bones
    2. Generate Rig and delete meta rig DeletingMeta.png
    3. Checked Def-* bones for Use Deform. (I also tried to put only the ORG-* bones instead but it lead to similar results). BonesDeform.png
    4. Ensured IK was functionnal IKSettings.png
    5. Export to FBX: Only deformation bones, and in the animation panel, I only left "Baked Animation" and Key all Bones" checked.
    6. Import to Unity. Animation type to humanoid. Apply
    7. Error. Missing bones. When I move to the configure panel I notice that: First: all the body parts are red. I have a long long long hierarchy with some bones that I thought were not deformable. Unity.png
    I'm kinda lost here. I thought the process would be more or less straightforward but it seems it is not. Could anyone give me a hand ?

    Thanks !
     
  2. deuxieme

    deuxieme

    Joined:
    Jul 15, 2015
    Posts:
    19
    Did you ever figure this out? I'm having a *hell* of a time trying to get this Rigify to Unity pipeline working. Unity consistently will create a gibberish avatar configuration, and cannot find the Head bone which is plainly there.
     
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,340
    We ended up doing some pretty heavy edits to rigify to make it play nice with Unity. We essentially make a copy of the meta rig, remove the bones we don't care about, and have the rest be constrained to follow the main rig.
    That imports directly to Unity, and all the humanoid bones that we have are found automatically.

    I could put it on github, but it's not quite ready for use, and our animator won't have the time to post any explanations for how to do things correctly. It might be a good starting step.
     
  4. deuxieme

    deuxieme

    Joined:
    Jul 15, 2015
    Posts:
    19

    Wow, that sounds great! I would certainly check it out! If you're comfortable making it available, it could be helpful. And if I can't figure it out, well, it's no big trouble because I'm already stuck :)

    At this point I'm looking at abandoning Rigify completely and rigging on my own, because at least my Rigs go into Unity perfectly fine.
     
  5. Mehd

    Mehd

    Joined:
    Apr 29, 2016
    Posts:
    91
  6. LudaKris

    LudaKris

    Joined:
    Mar 17, 2020
    Posts:
    3
    Hey!

    I'm trying to set up a smooth workflow between current Blender (2.82->) and Unity (2019.3->) versions. It's kind of hard, as I suspect you guys in this thread would know. I was wondering if any of you have a decent set up these days and wouldn't mind helping me out a bit.

    My current best try:
    - Metarig Human (with fingers and face, not basic).
    - Modded the RigifyToUnity-script (https://github.com/AlexLemminG/Rigify-To-Unity). Basically this script removes superfluous bones in legs, arms and spine. I extended it to remove palm bones and reparent finger bones from ORG to DEF_hands. It worked, so I would also punch in the lines for the face bones but couldn't be bothered yet, so just deleted them manually. Finally I added a few lines to set all tweak bones to default at 0.0, so I wouldn't need to manually drag them down for each use. I also added a non deform root bone as parent to all the DEF-bones.
    - The script generates a button to apply (Make Unity ready rig or smthng), and on my end it works both before and after making animations.
    - Deleted WGT-bones after making the rig "Unity ready" by running the modded script.
    - Export a human mesh parented to the rig, containing 3-4 animations for testing. I use the fbx-exporter settings for selected only, FBX Units Scale, apply transforms, deform-bones only, bake animations etc.
    - They imported with fewer errors than I feared into Unity. They play seemingly perfect in both generic and humanoid.
    - HOWEVER: the avatar (when selecting humanoid rig) is slightly skewed, one leg lifted up a tiny bit, it doesn't accept the T-pose, usually cause a forearm bone is marked red. Also, the animations tab say that there are errors regarding scale animations that will be discarded. The usual applying retargeting DOF in the muscles tab does nothing. Both errors are weird, and I cannot figure out why. Especially since I thoroughly cleaned the animations removing keyframes on all scale and tweak bones, except the finger master (which does not lead to scale errors on finger bones, as it just applies rotation to the finger knuckles).

    Here's to someone struggling to use this wonderful rigging tool with Unity, and having the time to help a fellow :D
     
    frarf likes this.