[Bf-gamedev] FBX remaining TODOs

Bastien Montagne montagne29 at wanadoo.fr
Tue Jul 22 17:36:11 CEST 2014


Hi, last week a I wrote 
http://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_TODO_2014_07,
a 'current status' of remaining FBX TODOs, as far as I can see them 
currently. These are rather complex topics.

We then exchanged a bit with Jens and Ton about it, but it’s better to 
keep tech/design discussion public,
so here is a summary of it (hope I did not forget anything!).

Jens spent some time to generate test files with Maya: 
http://www.restemeier.org/Maya2013.zip:
« These are generated with Maya 2013 and are written out to FBX 2013.
Maya has the advantage that it can operate in "Y-Up" mode and "Z-Up" 
mode, and the FBX exporter
can export to either as well. This way I have valid reference material 
to check the exporter and importer against.
Some of these files cause crashes or asserts in Blender that I'll have 
to look into as well. »

(double quotes are from wiki page, simple quotes are Jens' answers).

==Bake transform==
>>
>>
>>         Finish 'Bake transform' feature
>>
>>     This feature came from user request & patch. Issue is, when you
>>     export to another global orientation than Blender native one (Z
>>     up, Y forward), we apply some rotation to all objects, so that
>>     they still look in the right orientation in the target app. But
>>     this means objects in this target app will have some extra
>>     rotation (e.g. 90° around X axis…).
>>     To fix that, we added an option to 'bake' transformations into
>>     object's data itself, rather than object rotation. Currently,
>>     this is only working for meshes (and other geometries we convert
>>     to meshes during export).
>>     We are already working on a patch that extends this to empties
>>     and armatures, and if armatures are possible, should be as well
>>     for bones, maybe? Quite a complex task, though.
>>
> From my position the export was working how I wanted it to, but 
> Bastien pointed out some performance problems and problems in the 
> handling of bones. You will need similar code on the importer side, so 
> that a scene that was exported with baked transforms or that was 
> modelled with Y-up comes back correctly into Blender.
Ton also raised a valid point here - this feature should be available 
for all addons, in the end.

Would be a good starting point for an "io helper' py module, idea we 
already had with Campbell
for other topics as well (like cleanup options (e.g. to normalize 
weights) before exporting, and so on).

However, think we can keep that dev in FBX for now - once the correct 
set of transformations has been sorted out,
it should be easy to make it generic…

== Bones orientations==
>>
>>     And that's not so nice… Issue is, FBX bones are not aligned along
>>     the same axis as Blender bones (former are along -X axis I think,
>>     while later are along +Y axis).
>>     In current code, we do not rotate bones at all. This means they
>>     will import rotated in other apps, and files from other apps will
>>     import with rotated bones in Blender.
>>     This is not so nice, but it has a great advantage - skinning
>>     itself is OK, i.e. no distortions of animated rigged meshes, etc.
>>     I tried hard (very hard) to export and import corrected bones,
>>     but with no luck so far (I manage to export and import valid
>>     'rest' armature, but pose are always messed up in some way). And
>>     code from old 6.1 does not help me here, I have the feeling it
>>     was buggy too (might be wrong, of course, but could not get new
>>     code working based on it at least). Admittedly, I’m not a matrix
>>     expert, there is probably some ways to handle this, but I’m
>>     really tired of searching. :/
>>
> Unfortunately this is quite complicated. Maya doesn't have a defined 
> "Bone orientation", and you can specify this while building a 
> skeleton. Here is a screenshot of the joint editor tool:
> Inline-Bild 1
> (This dialog is cut-off on the right side, you can actually specify 
> any axis as primary axis. I did that for X and Y in the test files,)
>
> There seems to be a difference in concept as well: In Maya you edit 
> the joints between bones, and the visible bone just connects child 
> joints to parent joints:
> http://download.autodesk.com/global/docs/maya2014/en_us/files/CSS_Joints_and_bones.htm
>
> So during bone export I can think of these options, that a user may 
> choose depending on use-case:
>   - leave it alone. If the Y-axis points along a bone in Blender it 
> will point along it in FBX
>   - just treat it like other transforms and apply global_transform
>   - align a specific axis with a child. This transform would not be 
> reversible during import.
>   - align Y in blender with specified axis in fbx. That does something 
> similar to the up-axis conversion and lets a user decide which axis to 
> use.
> Similar during import:
>   - leave alone
>   - align the Y axis to a child
>   - just apply the global_transform
>   - align Y with a specific axis
>
> I don't have experience with the other major modelling apps, so maybe 
> there are more useful options, or options that will never be useful.
To summarize, some apps have no orientation concept at all, some have 
various, even configurable forward/up axes, and some (like Blender)
have a strict orientation expectations.

To top it all, afaik FBX does not store any data about that topic!

So I have the feeling we should indeed add several handling on import, 
looks like we can't go without that. :/
Not quite convinced we should bother about that on export, though. Game 
engines do not have issue about
current exported armatures, it seems, so… And our export UI is already 
quite cluttered too.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-gamedev/attachments/20140722/eda3dcc0/attachment.htm 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-gamedev/attachments/20140722/eda3dcc0/attachment-0001.htm 


More information about the Bf-gamedev mailing list