Search Unity

Character fbx not importing properly!

Discussion in 'Editor & General Support' started by Konidias, Aug 17, 2010.

  1. Konidias

    Konidias

    Joined:
    Feb 17, 2009
    Posts:
    50
    So I set up a super basic character mesh with a simple skeleton rig and tried to load the mesh into Unity. The mesh looks fine in the preview but then when I drag the object into the game, it just breaks.

    I'm using Lightwave 9.6 for the rig/model. Here is a snapshot of the skeleton in Lightwave:



    Here's what it looks like when I import it:



    Anyone have this happen to them? What could be going wrong? Does Unity need a certain bone naming convention? Am I missing a step? I followed several different importing tutorials and can't seem to get any different result.
     
  2. solid

    solid

    Joined:
    Jan 15, 2010
    Posts:
    132
    i've only had that happen to me if i Scaled bones.
    but its looks fine on the FBX import preview. so maybe some animation is messed up.
     
  3. Paulius-Liekis

    Paulius-Liekis

    Joined:
    Aug 31, 2009
    Posts:
    672
    Which Unity is it? Does it look ok when you play animation?
     
  4. Konidias

    Konidias

    Joined:
    Feb 17, 2009
    Posts:
    50
    I'm using Unity 2.6.1 for Windows, the current download on the site.

    I loaded a simple animation of the character lifting his arms and it shows up exactly the same as you see in the screenshot, except his arms lift. So it seems like it is a bone problem but I can't pinpoint what it could be. The animation looks to be fine aside from the fact that the character is eating itself.

    The rig seems totally normal in Lightwave, I set it up how a proper rig should be, so I'm not sure why Unity is not liking it.

    It seems like it might be an issue with the root/torso area? Because the upper body is fine, other than the fact that it's flipped upside down... the legs are fine, other than the fact that they are moved up from the ground and are inside of the torso...

    Could that be the problem? How should the root be set up? I tried the root bone having 100% influence and 0% influence, and also tried applying weightmaps to the root bone and it doesn't change anything.
     
  5. SystemIsGod

    SystemIsGod

    Joined:
    Aug 1, 2010
    Posts:
    178
    I've had similar problems, sometimes if you change scale from .01 to 1 it will change the model. Try that.
     
  6. stevets

    stevets

    Joined:
    Jul 6, 2010
    Posts:
    27
    Hi Konidias,
    I am using Lightwave 9.6.1 with Unity and finally have the FBX import working. I have also been able to animate with a mocap bvh file and then import into unity as FBX from Lightwave. It does work pretty well, but there are many ways to go wrong.

    Try resting the bones at frame 0. Do not scale or stretch the bones, use bone rest length.

    Use the Quicktime FBX plugin to view the file exported from Lightwave to check the integrity of your animation.

    Start with a very simple geometry, such as a cylinder with 4 bones, at first.

    It will work.

    Steve
     
  7. Konidias

    Konidias

    Joined:
    Feb 17, 2009
    Posts:
    50
    I'm at work but I'll be home shortly to give this advice a shot. I'm pretty sure I rested all the bones on frame 0, and none of them are scaled or stretched. I just created the bone, positioned and rotated it, and then used rest length to determine the length...

    I'll try changing the scale from .01 to 1 in Unity though.

    I will experiment with a few things and post results here, good or bad.
     
  8. Konidias

    Konidias

    Joined:
    Feb 17, 2009
    Posts:
    50
    Okay, I tried all the suggestions... nothing worked. I downloaded the Quicktime FBX viewer and viewed my fbx file in there, and it's broken just like in Unity... so that means it's an exporting issue out of Lightwave? I'm not really sure how to go about fixing this because I've been using rigs with Lightwave for years and I've never experienced this type of exporting issue with fbx files.
     
  9. stevets

    stevets

    Joined:
    Jul 6, 2010
    Posts:
    27
    If it failed in quicktime, the problem is in the lightwave setup. Did you "shift p"the bone rotations? How do you add the animation? I pose the character at frame 0 then add the the motion keyframes back using ik boost.
     
  10. Konidias

    Konidias

    Joined:
    Feb 17, 2009
    Posts:
    50
    The thing is, it's doing it with no animation at all. All bone channels are keyed at frame 0. All of the bone setup was done on frame 0.

    I recorded pivot rotation, rested, activated all of the bones... the rig works fine inside of lightwave, just breaks in the fbx. I tried all sorts of different fbx export options with no change in result.

    There's no animation at all in the fbx... other than the keys at frame 0. There's no nulls driving anything, there's no IK. It's just the bones and the mesh. The mesh is also all on one object layer.

    I purposely set this rig up to be the most basic and simplest human rig because I have never once been able to properly import a rigged character into Unity and it's driving me crazy. I just hit a huge wall and I can't find a way around it.

    I suppose I could use other 3d applications to export the fbx or something, but that's defeating the point. I use Lightwave as my primary modeling/rigging/animating tool, and Unity is supposed to be compatible with it... so I have no idea what's going on. It's not even Unity that's breaking the rig, but Lightwave is refusing to export the fbx without destroying the character. :(
     
  11. stevets

    stevets

    Joined:
    Jul 6, 2010
    Posts:
    27
    It works for me , so try something very simple to test with. Make 4 bone}s in a line place them in a cylinder object. Export to fbx. Open in Quicktime. If that works then try a simple keyframe animation on the bones. At least this will show if your fbx export plugin is working. If the previous test works, then your bones(in your charactor) are not setup correctly.
     
  12. solid

    solid

    Joined:
    Jan 15, 2010
    Posts:
    132
    can you provide the FBX file? maybe i can help.
     
  13. AlbertoT

    AlbertoT

    Joined:
    Mar 27, 2009
    Posts:
    159
    oohhh a problem to import an FBX file......really ? :wink:
     
  14. stevets

    stevets

    Joined:
    Jul 6, 2010
    Posts:
    27
    If you upload your LW scene file I can take a look at it.

    Steve
     
  15. Konidias

    Konidias

    Joined:
    Feb 17, 2009
    Posts:
    50
    Problem solved!

    I downloaded fbxlw80-53.zip from the download page:

    ftp://ftp.newtek.com/products/LightWave/Downloads/

    Ran it through 9.6 32 bit, and it worked like a charm. Just to make sure it wasn't 32 bit that was fixing it, I ran it through 9.6 32 bit using the built in exporter (File>Export>Export FBX) and it was broken again...

    So in conclusion, the new exporter built in to 9.6 is broken. Which is kind of disappointing that they have taken a step backwards. :(

    (oh and hi stevets! saw you replied to my newtek post as well. thanks anyway for being so willing to help me out!)
     
  16. stevets

    stevets

    Joined:
    Jul 6, 2010
    Posts:
    27
    Hi Konidias,

    Glad you solved your FBX problem:)

    I am using LW 64bit. The standard FBX export seems to work.

    Steve
     
  17. JasonB

    JasonB

    Joined:
    Dec 29, 2010
    Posts:
    102
    Sorry for bringing back an old thread, but I was having this same exact problem, and it does seem to be because of recording pivot rotations. The exporter can't handle it. It's driving me nuts, I can't animate my character properly without doing a RPR because the axises simply aren't aligned right without it. If I use the built-in exporter, I get some wadded up ball of a character inside Unity that wiggles around and looks quite disturbing.

    I'm about to try downloading the FBX exporter Konidias posted... will report if it solves my problem as well.

    Stevets: I'm actually using 64-bit Lightwave while having this problem; I wouldn't go as far as to say that the standard FBX exporter works. Have you tried exporting a skeleton you've done RPR's on? RPR seems to break it regardless of which bit version you use... don't know.
     
  18. Ricks

    Ricks

    Joined:
    Jun 17, 2010
    Posts:
    650
    Thanks a lot for pointing this out, saved my day. The default exporter seems broken and did not include animation weights, causing distorted animations. The new plugin fixed it. Also make sure you check Materials and Textures on export otherwise the object loses it's UV data.