From BlenderWiki

< Extensions:Py | Scripts | Manual | Export
Revision as of 18:29, 21 September 2009 by 208.87.198.126 (Talk)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[edit] Autodesk FBX Exporter

[edit] About

Name Autodesk FBX Version 1.1 - 2006.10.01
Selection to an ASCII Autodesk FBX License GPL
Menu File → Export → Autodesk FBX (.fbx)... Blender 2.44 and newer
Author Campbell Barton (ideasman42)
Link(s) this script comes with Blender.
Executable: export_fbx.py Modules:
Data: External Dependencies: None
Additional information: * Included in Blender 2.44 - 2.47.

[edit] Introduction

Export selected objects to Autodesks .FBX file format.

This format is mainly use for interchanging character animations between applications and is supported applications such as Cinema4D, Maya, 3dstudio MAX, Wings3D and engines such as Unity3D.

[edit] Support

[edit] Links

[edit] Usage

[edit] Instructions

  • Select the objects you want to export
  • Launch the exporter from the File → Export menu
  • Set the options in the user interface (Default options should be okay in most situations)
  • Press the "Export" button
  • Select the filename to export to.

[edit] Configuration

These options will be presented at export time. in most cases the defaults should be good to use.

[edit] Export Objects

Selected Object / Scene Objects SWITCHSelected Objects
Selected Object - Only export the selected objects.
Scene Objects - Export all objects in the current scene.
Note! this does not apply when batch exporting.
Scale NUMBER10.0
Scale the exported data by this value. 10 is the default because this fits best with the scale most applications import FBX to.
Rot X90/Rot Y90/Rot Z90 TOGGLERot X90
Rotate the models 90d by these axises. Use this to orient the model in the direction other applications use.
Empty/Camera/Lamp/Armature/Mesh TOGGLEON
Enable/Disable exporting of respective object types.
(Mesh) Modifiers TOGGLEOFF
When enabled, the mesh will be from the output of the modifiers applied to the mesh
This will stop armature animation from working.
(Mesh) HQ Normals TOGGLEOFF
Calculate higher quality normals for exporting, use this where the resulting normals will be rendered.
Copy Image Files TOGGLEOFF
Copy mesh images to the FBX's destination path.

[edit] Export Animation

Enable Animation TOGGLEON
Export armature bone and object animation.
Optimize TOGGLEON
remove duplicate keyframes when they are not needed.
Optimize Precision NUMBER6
Tolerance for comparing double keyframes (higher for greater accuracy), 6 allows 0.000001 difference or less for removal.
Current Action/All Actions SWITCHCurrent Action
Current Action - Use actions currently applied to the armatures (use scene start/end frame)
All Actions - Export each actions as an FBX 'Take', When an action has at least one channel name matching a bone name it will be exported as a take for that armature. Start/end times are derived from the keyframe range of each action.

[edit] Batch Export

Enable Batch TOGGLEOFF
When enabled, export each group or scene to a file.
Group > File / Scene > File SWITCHGroup > File
Choose whether to batch export groups or scenes to files.
Note! when Group > Scene is enabled, you cannot use the animation option Current Action since that uses scene data and groups are not attached to any scenes.
Note! when Group > Scene is enabled you must include the armature objects in the group for animated actions to work.
Own Dir TOGGLEOFF
When enabled, each file is exported into its own directory, this is useful when using the "Copy Images" option. so each directory contains 1 model with all the images it uses.
Note This requires a full python installation, if you do not have a full python installation this button will not be shown.
Prefix TEXT(filename)
prefix the scene/group name with this text when exporting, its also used for the name of the directory when "Own Dir" option is enabled.

[edit] Notes

  • Materials textures are exported from UV face textures not material textures.

[edit] Examples

Here is a blend that contains many examples each in a scene. Including motion capture, modifiers, uv/color layers, materials, armatures and more.

To export all examples at once, open the blend file, run the exporter, Enable Batch, Select "File->Scene" option, set the animation option to "Scene Frames", enable "Copy Images" and export.

Fbx_test_examples.zip

A single animated character (used in screenshots below)
fbxExample.zip (includes blend file, images and exported fbx)

[edit] Command Line Converting

Here is a script that will convert a blend to an FBX from the command line on most unix systems

(note that it will only use the active scene) convertBlendToFbx.sh

Download this script and make it executable

chmod +x convertBlendToFbx.sh

Then convert a blend

convertBlendToFbx.sh /home/me/from.blend /home/me/to.fbx

[edit] Compatibility

  • Nurbs surfaces, text3d and metaballs are converted to meshes at export time.

[edit] Supported

Objects
  • Object Animation (Location/Scale/Rotation)
  • Object Groups
  • Object Parent/Child Hierarchy
    Note, parents/children will only be exported if they are selected.
    Do not used skinned meshes as children of other objects (except their own armature) This dosnt work reliably


Object Types
  • Meshes - See below
  • Metaballs, Nurbs Surface, Text3D (written as FBX mesh objects)
  • Particles (strands as mesh edges)
  • Cameras - see below
  • Armatures - see below
  • Lamps - see below
  • Empties - see below


Meshes
  • Verts/Edges/Faces/Normals
  • Smooth/Flat Faces, Soft/Sharp Edges
  • UV Coordinates (multiple named layers supported)
  • Vertex Colors (multiple named layers supported)
  • Armature Deformation
    Only 1 armature modifier can be used on each mesh.
    Armature envelopes will only work when the mesh "Modifier" option is enabled, otherwise they must be manually converted to weight groups before exporting.
Armatures
  • Bones.
    Bone use the same name space as objects, naming collisions are solved by the exporter.
  • Parent Bones.
    Meshes with parent bones are exported as weighted meshes
  • Animation.
    Animated armatures are exported with keyframes, The results of constraints and IK's etc will be exported however the constraints and other settings are not saved into the FBX file.
  • Actions (Multiple actions to FBX Takes).
    When the "All Actions" option is enabled, actions will be exported for each armature when an action has at least 1 name that matches an armatures bone.
Lamps
  • Energy
  • Color
  • Distance
  • Type (Point/Directional/Spot)
  • Spot Size
Materials
  • Color: diffuse, specular, ambient.
  • Shader settings: shininess, transparency, emit.
  • Shader (phong or lambert)
  • Shadeless
  • Images Texface Material Textures are not supported
Cameras
  • Clip start/end
  • Field of view
  • ShiftX/ShiftY
  • Aspect ratio

[edit] Missing

Some of the following features are missing because they are not supported by the FBX format, others may be added later later.

  • Object Instancing
    exported objects do not share data, instanced objects will each be written with their own data
  • Material textures.
    only texface images are supported.
  • Vertex Shape Keys.
    FBX Supports but this exporter does not write them yet
  • Animated Fluid Simulation
    FBX does not support this kind of animation, You can however use use the OBJ exporter to write a sequence of files.
  • Constraints
    The result of using constraints is exported as a keyframe animation however the constraints themselves are not saved in the FBX
  • Dupli Objects.
    At the moment dupli objects are only written in static scenes (when animation is disabled)

[edit] Interoperability

Blender3D

This file was exported from blender, you can grab the FBX and Blend file here. http://members.optusnet.com.au/cjbarton/fbxExample.zip


[edit] Motion Builder

MotionBuilder

Tests Passed...

  • Character animation
  • Materials
  • Textures
  • Lamps
  • Cameras
  • Empty's

Notes...

  • Imported models will often appear small, press the A key to resize the view.
  • Mesh vertex color is not displayed

[edit] Cinema4D

Cinema4D

Tests Passed...

  • Character animation
  • Materials
  • Textures
  • Lamps
  • Cameras
  • Empty's

Notes...

  • Imported models will often be small, press Hkey to resize the view.
  • Mesh vertex color is not displayed

[edit] 3D Studio Max

3D Studio Max

Blender to 3DStudio Max Tutorial

Tests Passed...

  • Character animation
  • Materials (see below)
  • TODO further testing...

Notes...

  • Imported materials have low alpha/opacity, possibly a bug in the 3DS MAX importer.


[edit] Maya

Maya

Tests Passed...

  • Character animation (Maya 8.0 or greater)
  • Materials
  • TODO further testing...

Notes...

  • Dont scale the armature object since maya does not support non uniform scaled bones.

[edit] Deep Exploration (Right Hemisphere)

Deep Exploration

Tests Passed...

  • Character animation (The example model imported with some problems)
  • Materials
  • Textures
  • TODO further testing...

Notes...

  • When exporting armature animation, disable "Optimize Keyframes" otherwise you may get bad bone interpolation.
  • With animations, once imported you'll need to select the default action at the bottom of the screen. to play the animation.
  • Some character animations to not deform properly, since other programs display this correctly I assume this is a problem with Deep Exploration --Ideasman42 00:34, 31 August 2007 (CEST)

[edit] Modo

Modo

Tests Passed...

  • Meshes
  • Textures
  • TODO further testing...

Notes...

  • Modo does not support animation

[edit] Endorphin (NaturalMotion)

Tests Passed...

  • Armature animation

Notes...

  • Endorphin only supports FBX's bones, all other objects are importes as bones.
    Before exporting make sure you de-select armatures only, unless you want your camera as a bone.
  • Start and end frames are not imported, youll need to set them after importing.

[edit] Cheetah3D

Cheetah3D

Tests Passed...

  • Character animation
  • Materials
  • Textures

[edit] Carrara

Carrara

Tests Passed...

  • Character animation
  • Materials
  • Textures

[edit] Unity3D

Unity3D

Tests Passed...

  • Character animation
  • Materials
  • Textures

Notes...

  • Cameras and lights are imported just as placeholders.
  • When using armature deformed meshes, All vertices's must be influenced by at least one bone, or it will look like the vertex is in some far off place.

[edit] C4 Game Engine

See the [C4 Engine Wiki] for notes on getting models into the C4 Engine with the fbx exporter.

[edit] Known Issues

  • If your running python 2.3 you'll need a full python installation.

[edit] Dupli's

  • Exporting DupliObjects (dupliVerts, dupliFaces, dupliFrames, dupliGroups) does not work in 2.45rc2 (It has since been fixed)
  • Dupli Objects dont support animation export. (disable animation for dupli's to work)
  • Armatures in dupli's do not export

[edit] Additional Information

Executable: export_fbx.py Modules: BPyMesh.py, BPyObject.py, BPyMessages.py, BPySys.py
Data: External Dependencies: None