Tangents/bitangents missing from exported FBX model #39792

Closed
opened 2014-04-19 03:23:00 +02:00 by Darren Keese · 15 comments

System Information
Windows 7 64bit

Blender Version
2.70 4ed16bc

When exporting a static model as FBX, tangents and bitangents are missing in the .fbx file.

Exact steps for others to reproduce the error
Default new file.
Select the cube and add a material.
Under the Material's Shading section, check Tangent Shading. (Unnecessary to reproduce bug, but I thought it might be required.)
Add a new image file texture to the material. Create a new one and assign Color Grid to make it visible.
Set texture's mapping coordinates to UV and check it's Influence box for Normal under Geometry.
Go to UV Editing interface and perform cube projection on all vertices.
Go to File->Export->Autodesk FBX
Check Selected Objects and Tangent Space. Save the fbx file.
Observe, using FBX SDK that there are no tangents or bitangents in the fbx file when it is imported. This happens with the binary. With the ASCII export, I can read the file and see no tangents or bitangents.

fbx_tangents.blend

**System Information** Windows 7 64bit **Blender Version** 2.70 4ed16bc When exporting a static model as FBX, tangents and bitangents are missing in the .fbx file. **Exact steps for others to reproduce the error** Default new file. Select the cube and add a material. Under the Material's Shading section, check Tangent Shading. (Unnecessary to reproduce bug, but I thought it might be required.) Add a new image file texture to the material. Create a new one and assign Color Grid to make it visible. Set texture's mapping coordinates to UV and check it's Influence box for Normal under Geometry. Go to UV Editing interface and perform cube projection on all vertices. Go to File->Export->Autodesk FBX Check Selected Objects and Tangent Space. Save the fbx file. Observe, using FBX SDK that there are no tangents or bitangents in the fbx file when it is imported. This happens with the binary. With the ASCII export, I can read the file and see no tangents or bitangents. [fbx_tangents.blend](https://archive.blender.org/developer/F85223/fbx_tangents.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Bastien Montagne was assigned by Darren Keese 2014-04-19 03:23:00 +02:00
Author

Added subscriber: @cypherdare

Added subscriber: @cypherdare
Author

To clarify, I know tangents may not be in a mesh imported to Blender from FBX. I mean that when I use a third party program (in my case, libgdx/fbx-conv) that relies on the FBX SDK to import and translate the mesh, the mesh does not have tangent or bitangent attributes for the vertices.

To clarify, I know tangents may not be in a mesh imported to Blender from FBX. I mean that when I use a third party program (in my case, libgdx/fbx-conv) that relies on the FBX SDK to import and translate the mesh, the mesh does not have tangent or bitangent attributes for the vertices.

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

Legacy ASCII 6.1 exporter does not support tangents, this is expected.

I just fixed a typo in bin 7.4 exporter, but it does not seems to be enough for Unity (though data are in FBX mesh, likely yet another tiny details that breaks it). Could you please attach a valid FBX file having working tangents/binormals (the simpler the better)? It should be saved with a recent version of Maya/Max/... (i.e. be in the 7.x family of FBX formats).

Legacy ASCII 6.1 exporter does not support tangents, this is expected. I just fixed a typo in bin 7.4 exporter, but it does not seems to be enough for Unity (though data are in FBX mesh, likely yet another tiny details that breaks it). Could you please attach a valid FBX file having working tangents/binormals (the simpler the better)? It should be saved with a recent version of Maya/Max/... (i.e. be in the 7.x family of FBX formats).
Author

I don't use anything besides Blender, but I can try downloading a trial of one of the Autodesk programs tomorrow night and making one.

I haven't used Unity in a while, but I seem to remember Unity generating its own tangents when importing a model, if you have set a normal map on the model correctly. So I'm not sure if it just ignores FBX tangents and generates its own. And maybe it is not showing tangents because you don't have the materials set up just so in Unity. Maybe I can experiment with that this weekend.

I'm personally interested in using this with LibGDX, which uses the LibGDX fbx-conv program to convert FBX files into their own G3D format. I looked over the source of fbx-conv, and it seems to rely completely on the FBX SDK to acquire the mesh. So as far as I can tell from the source, tangents will definitely be in the exported G3D file if they were in the original FBX file, provided the FBX SDK isn't buggy.

So this might be a good way to test the validity of the FBX file's tangents. You can export G3D as a JSON file instead of binary so you can easily see if the tangents are there. The vertex attributes are listed right at the top of the JSON file.

Example: fbx-conv -o G3DJ input.fbx output.g3dj

Can you attach an FBX file that you've exported with your latest? I'd like to see how it does with fbx-conv if you don't have the time.

I don't use anything besides Blender, but I can try downloading a trial of one of the Autodesk programs tomorrow night and making one. I haven't used Unity in a while, but I seem to remember Unity generating its own tangents when importing a model, if you have set a normal map on the model correctly. So I'm not sure if it just ignores FBX tangents and generates its own. And maybe it is not showing tangents because you don't have the materials set up just so in Unity. Maybe I can experiment with that this weekend. I'm personally interested in using this with LibGDX, which uses the LibGDX [fbx-conv ](https://github.com/libgdx/fbx-conv) program to convert FBX files into their own G3D format. I looked over the source of **fbx-conv**, and it seems to rely completely on the FBX SDK to acquire the mesh. So as far as I can tell from the source, tangents will definitely be in the exported G3D file if they were in the original FBX file, provided the FBX SDK isn't buggy. So this might be a good way to test the validity of the FBX file's tangents. You can export G3D as a JSON file instead of binary so you can easily see if the tangents are there. The vertex attributes are listed right at the top of the JSON file. Example: `fbx-conv -o G3DJ input.fbx output.g3dj` Can you attach an FBX file that you've exported with your latest? I'd like to see how it does with fbx-conv if you don't have the time.

untitled_blend.fbx

Note Unity computes tangents by default, but has an option to import them instead (and with this files, this generates a warning saying there is no tangent nor binormal data). And since Unity uses FBXSDK like everyone else but Blender…

[untitled_blend.fbx](https://archive.blender.org/developer/F85788/untitled_blend.fbx) Note Unity computes tangents by default, but has an option to import them instead (and with this files, this generates a warning saying there is no tangent nor binormal data). And since Unity uses FBXSDK like everyone else but Blender…
Author

OK, same result in fbx-conv, no tangent or bitangent attributes, which follows what you said since they both use the FBX SDK. I'll try to get you that Maya-exported file tonight.

OK, same result in fbx-conv, no tangent or bitangent attributes, which follows what you said since they both use the FBX SDK. I'll try to get you that Maya-exported file tonight.
Author

I didn't have enough time to check this file over after exporting. Took me a while to figure out how to make it since I haven't used Maya since the Maya PLE days about 10 years ago.

It may not have normals and bitangents and bitangents. If not, I'll try to redo it tonight.

simple_block.fbx

I didn't have enough time to check this file over after exporting. Took me a while to figure out how to make it since I haven't used Maya since the Maya PLE days about 10 years ago. It may not have normals and bitangents and bitangents. If not, I'll try to redo it tonight. [simple_block.fbx](https://archive.blender.org/developer/F85888/simple_block.fbx)

This issue was referenced by blender/blender-addons@7aebdfb396

This issue was referenced by blender/blender-addons@7aebdfb396ef1a7899f361bf429dbeba4fdab67b

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Closed by commit blender/blender-addons@7aebdfb396.

@cypherdare Thanks for the file (ultimately, was yet another stupid tiny detail missing in generated FBX :/ ). Could you please test one of our next nightly builds tomorrow to check it actually works as expected? All I can say is that Unity now seems to load them OK (no warning nor error message)…

@cypherdare Thanks for the file (ultimately, was yet another stupid tiny detail missing in generated FBX :/ ). Could you please test one of our next [nightly builds](http://builder.blender.org/download) tomorrow to check it actually works as expected? All I can say is that Unity now seems to load them OK (no warning nor error message)…
Author

It's working in LibGDX via fbx-conv. Thank you for working through this! It's going to be well appreciated by many indie game developers, I think.

It's working in LibGDX via fbx-conv. Thank you for working through this! It's going to be well appreciated by many indie game developers, I think.

Cool, and thanks for the feedback! :)

Cool, and thanks for the feedback! :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#39792
No description provided.