Sketchfab Forum

Blender Armature not importing correctly - Bones have incorrect rotation and position

fbx
blender
upload

(Kochich) #1

Good day, everybody.
This is a problem I just spent half day trying to fix on my own before finally deciding to call for help.
To put a long story short, I have a model that should look like this:


It is a model of an old handheld console, with a twist. Different copies of the outer shell and buttons are hidden inside the pedestal. The idea is that by selecting different animation takes in the Sketchfab viewer, the colour of the shell and the buttons would appear to change.
The switching is done by an armature, that is just handful of bones, each of which has a single keyframe in every action strip.

The result given by Sketchfab… is not the best:


This exported from blender to FBX and then uploaded.

To list everything I did to try and fix this:

    • Sketchfab uploader plugin - exact same result.
    • Tweaking FBX exporter settings - I managed to change and almost fix the orientation of the bones by brute-force trial and error of various exporter settings. Setting some axis values to -Y and -X made the objects (probably accidentally) line up the way they should be in rotation, however their position was still wrong, as if they were moved to the root of the bone instead of the given offset.
    • Uploading the Blend file directly - no difference.
    • Changing the rotation mode of the bones bones from Euler to Quaternion - made it even worse.

I could just upload a static version of the model, without the interactivity I originally hoped for, but I don’t want to throw in the towel just yet.

I imagine the solution is actually embarrassingly simple and I’m just too stupid to see it.
That’s why I hope somebody out here will be able to help me make this work, or at least help me understand why and how this is happening (Before this I’ve had already uploaded one rigged model, and that one had no problems, which doubles my confusion as of what did I do wrong here).

In case it helps in any way, here is a folder containing both the current FBX file as well as the Blender project file: https://drive.google.com/drive/folders/1tnj9fug9Ip-tUIwCuQOlx3KiblL_yScY?usp=sharing

Thank you very much for your time,


(Kochich) #2

PS: I’m currently not worrying about textures and materials, as I plan to add those in the editor after everything else works.
Although I am also wondering why the Right Trigger button appears to have a texture, even though it shares its material with the Left Trigger and thus they should look the same (that is untextured just like the rest of the models).


(Stephomi) #3

When I open the FBX in FBX Review, I got the same results as in sketchfab.
If I upload PSPFAB.blend, I got a static model in sketchfab.

But I’ll let @waleguene investigate the issue more thoroughly.


(Kochich) #4

That would confirm my suspicions that this is in fact all the result of my own stupidity and probably not even related to Sketchfab… How great.

Knowing that, I actually managed to fix one part of the problem though.
Turns out I forgot to Apply the transformations in Blender, which caused the position offset and some deformations.
With the transformations applied, the rigged parts of the object are almost where I need them and everything is straight, although clearly the bones are still misaligned:

Now it’s “only” 180° off on the vertical axis and about its own height higher than it should.
I tried different combinations of bone axis in the exporter settings (not all, mind you), but the image above is as close as I could get. The exporter settings for that are +Y as the Primary bone axis, and +X as the Secondary bone axis.


(Shaderbytes) #5

if you share your blend file i can have a look for you as well?


(Kochich) #6

Sure thing, the link at the end of my first post is a Google Drive folder which contains the blend files as well as the fbx exports.


(Shaderbytes) #7

i looked at the blend file , here are some observations i see , things to avoid in future :

  1. apply all scale and rotations to objects before you skin them

  2. make sure the object/s origin is the same as your armature

While these are not absolute have to’s they are good practice to avoid cross platform errors in general.


(Kochich) #8

Thank you, I completely agree with that. Applying the transforms is what almost fixed the export above, after all.
I will guess that having the origins put to the same place after the objects are parented to the bones doesn’t work the same though, hence the remaining offset and rotation.

But! This gave me an idea thanks to which I was able to actually achieve a full fix:

I decided to try and see if and how moving the origin of the armature affects the export. And surprisingly it worked. By moving the armature’s origin up from 0, the rigged parts moved down the same amount closer to 0 in the exported FBX. The same worked for rotation.

While it isn’t the most elegant of solutions, it achieves what I wanted: Both the source project and the exported FBX look the same.


(Shaderbytes) #9

cool , im sure there is also some sketchfab bug at play here since uplloading the .blend file ( after origins were fixed) has the correct results… uploading the fbx is still buggy :

I recently had a similar issue with a model and the fbx did not render properly on sketchfab , yet uploading the blend file the very same fbx was exported from yielded correct results

something the devs need to look into


(Kochich) #10

Well I don’t really understand how anything of this works. But my suspicion actually falls on the FBX exporter in Blender. If Blender and Sketchfab communicate correctly and the exported FBX doesn’t, then perhaps the translation process between Blender and FBX is borked.

I’m just glad I got it working after almost a full day of frustration. xD


(Shaderbytes) #11

could be but also a chance the sketchfab importer of fbx has some quirks :wink: anyway glad you got everything sorted, im sure you are happy hehe


(Stephomi) #12

could be but also a chance the sketchfab importer of fbx has some quirks

What FBX are you talking about?
The ones posted in the first post archive is definitely buggy (broken as well, in other 3d software).

The FBX export in blender is known to be brittle.


(Shaderbytes) #13

@stephomi sent you a pm


#14

The right trigger appearing to have a color/texture is almost certainly due to a non-uniform scale (i.e. Mirror modifier) that messes with the vertex normals. Applying scale so that everything is [1, 1, 1] should also fix this issue. Sometimes you also need to recalculate normals after applying the scale.