# Problems with exporting FBX files

This topic is 1053 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am trying to add FBX export to one of my tools to keep the TA's happy.

The file I am trying to export is a structure of meshes that form an aircraft. So wings are children of the main body, ailerons children of the wing and so on.

I can export them all and keep the structure intact, however I cannot get the transformation matrices correct.

Looking at the FBX file structure I can see four sets of transformation data lcl  (local),  pre (I guess pre -animation) , post (I guess post animation), and geometric (no clue).

I started out using the lcl transformation set and had some success. The mesh parts appeared in the correct location but totally in the wrong orientation. Since then I have tried all the options with no success.

Using pre,post,and geometric ends up with all my mesh parts at 0,0,0 and all in the incorrect orientation.

Using lcl I get translation, but no rotation.

I have tried everything I can think of and I am getting nowhere.

I have tried....

Rotations in degrees

Making all mesh parts a child of the root node

Setting all four sets to the same values

Editing the FBX file by hand

Setting all flags and limits by hand.

......

Just nothing.

To test the FBX files I am using Autodesk's own viewer, so it's not an issue with my rendering code.

Please someone put me out of my misery, or at least give me some sort of clue to figure out what is going on.

##### Share on other sites

No that's no use.

I am exporting a mesh as FBX and viewing it in third party apps.  The values I am exporting exist in the fbx file, but are not applied to the mesh parts when in the viewer.

So when loaded into 3ds max, the mesh parts are all rotated incorrectly.

When displaying with autodesk's own fbx viewer they are rotated incorrectly.

Changing the rotation values  in the FBX file has no effect on the results in either tool.

Edited by Stainless

##### Share on other sites

Are you using the same coordinate system as FBX?

What works for me is just storing the local transformations, but I have to convert into the right handed coordinate system where negative z points into the depth, y points up and x to the right.

fbxNode->LclTranslation.Set( FbxVector4(pos.x, pos.y, -pos.z) );
fbxNode->LclScaling.Set( FbxVector4(scale.x, scale.y, scale.z) );


Also make sure to use degrees instead of radians in this function.

I was able to export full characters including bone hierarchies etc for some clients using this code, and they appeared correct in Max after importing the FBX, so I assume this must work for you as well, unless something else is going on.

##### Share on other sites

Degrees.........  Degrees ......  angles in degrees.... what is this ? The stone age.

Sigh.

That helps a lot, thanks.  I still have issues though. I got bitten by the coordinate system as well, but that's easy to fix.

It now looks like local translations are not absolute but relative. So the parent nodes matrix is applied first. Will confirm that later today and report back.

Could be a bug in my code though, we'll see.

##### Share on other sites

Local transformations are relative to their parent indeed.

1. 1
2. 2
Rutin
20
3. 3
4. 4
frob
14
5. 5

• 12
• 9
• 17
• 16
• 9
• ### Forum Statistics

• Total Topics
632597
• Total Posts
3007325

×