FBX exporter improvements WIP #36971

Closed
opened 2013-10-06 11:33:24 +02:00 by Jens Restemeier · 5 comments

%%%I am currently working on the Blender FBX exporter to improve integration with Unity3D (http://unity3d.com/ ). Main issues are to bake the space transform (from Z up to Y up) into the mesh data, and to export textures assigned to a material so that normal maps come across correctly.

Please don't apply the patch, yet. I am currently collecting feedback from the Unity3D community and want to implement their fixes first. I just want to avoid duplicated work by someone else.

I tried to implement these changes in a way that is compatible with all applications using FBX, but I have only Unity3D to test.
%%%

%%%I am currently working on the Blender FBX exporter to improve integration with Unity3D (http://unity3d.com/ ). Main issues are to bake the space transform (from Z up to Y up) into the mesh data, and to export textures assigned to a material so that normal maps come across correctly. Please don't apply the patch, yet. I am currently collecting feedback from the Unity3D community and want to implement their fixes first. I just want to avoid duplicated work by someone else. I tried to implement these changes in a way that is compatible with all applications using FBX, but I have only Unity3D to test. %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

%%%I spoke with someone else who submitted an improved FBX exporter a few months ago, and I decided to split my patch into two. From what I understand you're doing a total rewrite of the FBX IO anyway, so please just consider the idea behind the patches. I think he did more work exporting blend modes between texture layers, while I was more interested in getting Unity3D to pick up correct diffuse and normal maps.

To summarise the patches:
io_scene_material.patch : If a material is set on a face, the textures on the uv layers are ignored and the textures on the material are exported instead. I tried to find reasonable keywords for the different texture types, but Unity3D only picks up diffuse and normal, so the rest is untested. If no material is set a dummy material with the textures from the uv layers is created. I think the other FBX script did more work in matching blend modes and material settings, so you may want to use that one instead.

io_scene_geom.patch: The default fbx exporter only appends the space transform (Z up to Y up) onto each world matrix. As a result you'll get mostly unchanged transforms in Unity3D, with a 90 degree rotation around X on the root transform. That is a bit awkward for example with code that expects an identity on the root transform, or the terrain instancing system. To make that work a user would have to export objects laying on the side in Blender. To make this work more intuitively I added code to bake this transform into vertices and normals. This defaults to off, because it may confuse Unity3D after an object that was imported with the old exporter is imported with the new importer. It would be useful if that was exposed as a setting in Unity3D, but I'm not sure if I could reach a developer responsible for fbx import, of if I'd run into a wall at tech support.

%%%

%%%I spoke with someone else who submitted an improved FBX exporter a few months ago, and I decided to split my patch into two. From what I understand you're doing a total rewrite of the FBX IO anyway, so please just consider the idea behind the patches. I think he did more work exporting blend modes between texture layers, while I was more interested in getting Unity3D to pick up correct diffuse and normal maps. To summarise the patches: io_scene_material.patch : If a material is set on a face, the textures on the uv layers are ignored and the textures on the material are exported instead. I tried to find reasonable keywords for the different texture types, but Unity3D only picks up diffuse and normal, so the rest is untested. If no material is set a dummy material with the textures from the uv layers is created. I think the other FBX script did more work in matching blend modes and material settings, so you may want to use that one instead. io_scene_geom.patch: The default fbx exporter only appends the space transform (Z up to Y up) onto each world matrix. As a result you'll get mostly unchanged transforms in Unity3D, with a 90 degree rotation around X on the root transform. That is a bit awkward for example with code that expects an identity on the root transform, or the terrain instancing system. To make that work a user would have to export objects laying on the side in Blender. To make this work more intuitively I added code to bake this transform into vertices and normals. This defaults to off, because it may confuse Unity3D after an object that was imported with the old exporter is imported with the new importer. It would be useful if that was exposed as a setting in Unity3D, but I'm not sure if I could reach a developer responsible for fbx import, of if I'd run into a wall at tech support. %%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2014-08-03 10:31:10 +02:00

Think we can close this one, Jens? If there are still some valid work in here, please use fbx wip branch for it! :)

Think we can close this one, Jens? If there are still some valid work in here, please use fbx wip branch for it! :)
Author
Member

Yes, this was old stuff against the ascii exporter and they are already in the new binary exporter.

Yes, this was old stuff against the ascii exporter and they are already in the new binary exporter.
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
2 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#36971
No description provided.