[Bf-gamedev] FBX importer and exporter work

Jens Christian Restemeier jens.restemeier at gmail.com
Wed Aug 20 19:10:40 CEST 2014


Hi All,
Over the past few weeks I did some work on the FBX importer and exporter. I
just want to report the results and give some suggestions for further
discussions.

Excluding minor bugfixes, the main patches are:

https://developer.blender.org/D687 Import custom properties
https://developer.blender.org/D732 Bone orientation during import
https://developer.blender.org/D735 Bone orientation during export
https://developer.blender.org/D607 Transform baking during export
https://developer.blender.org/D739 Transform baking during import

They are not all approved, yet, so they are not in git. I included more
detailed documentation in the patch notes, but a summary:

Import custom properties is relatively simple: If you add dynamic
properties to a node for example in Maya they are written to an FBX as user
properties. The importer should pick most of them up and add them to the
corresponding Blender node. Additionally it supports 3DS-Max style custom
properties that are just stored as a single key/value string.

This is similar to the custom properties that can be exported from Blender,
and used for example in Unity3D with
AssetPostprocessor.OnPostprocessGameObjectWithUserProperties .

Bone orientation during import tries to orient bones so that the Y-axis of
a joint is aligned with the bone. Other modelling applications (for example
Maya) don't manage bones, but instead the joints between bones.
Additionally there is no orientation enforced, so the code needs to do some
auto-detection. It does some good work, IMHO.
Additionally the code can ignore "leaf" or "end" joints that are added to
the end of a bone chain to set the length of the last bone.

Bone orientation during export does the reverse: If you have an application
that needs a specific orientation when a bone is exported the code can
change this during export. I'm not sure if any application strictly
requires a change to the bone orientation, so it would be a matter of
discussion if you want this change. Additionally it can add a "leaf" or
"end" bone to all bones that don't have children, so they work as expected
in other applications. The patch documentation has pictures.

Transform baking gets rid of the 90 degree rotation on transforms if you
export to another program that works with Y up instead of Z up, and for
example makes instancing terrain geometry a PITA in Unity3D. This works by
baking the necessary axis conversion into vertex data and fixing up the
transforms properly. The math for that is quite complicated, but I was
happy with the results for my work.

Ton suggested to investigate if some of this code could be generalised for
use in other exporters. I think best candidate for that is to generalise
the ObjectWrapper class from fbx_utils and the new FbxImportHelperNode
class from my importer code. That way you can apply changes to hierarchy
and transforms without modifying the Blender scene or introducing special
cases. I do have some other work coming up, so I can't do it myself, though.

Cheers,
Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-gamedev/attachments/20140820/748098ba/attachment.htm 


More information about the Bf-gamedev mailing list