[Bf-gamedev] New FBX Exporter

Mango Jambo moraesjunior at gmail.com
Tue Jun 24 16:47:25 CEST 2014


Hi,

I work at Oniria Company and we make simulators for huge companies, like
Vale, Petrobras, CaseIH, etc. They hired me to migrate the workflow to
Blender 6 years ago. So, since that day, our mainly workflow is to develop
Art in Blender and code in Unity. I just told about our clients to you know
how important this script was and is to make possible to use Blender in a
project so demanding. This new version is an amazing improvement for this
workflow.

How do we work here?
At the beginning we use to let Unity import .blend directly. There is a .py
at Unity/Data/Tools folder to use a Blender installation to do that. It
probably generates a .fbx at Library folder, or something like that. But it
was horrible, because Unity use to broke the references when importing. So
we had to fix it by hand. Dull work.
So we decide to always delete this .py and use Blender to generate our
.FBX. It was a great decision and gave us some good results:
- Better control about what is importing or not;
- We can let huge .blend files inside the Assets folder and Unity will
never take that long long time to import it anymore (Best Unity error:
Unity was unable to import a Blender file!);
- So Unity imports only .fbx;
- We could set groups to export. Sometimes after some months we use to
forget what objects from the file we should export and grouping was a good
solution for this;
- Easy to export multiple .fbx files from one .blend using groups;
- Faster workflow: no more .blend import time and easily export .fbx to the
same .blend folder.
I know it sounds a little bit repetitive, but working with it every day it
is kind of important for us.

So, soon the buildbot was released I made some tests here:

*Working*
Apply Transform - Thank you so much for this one! Z up vs Y up are alwas a
mess for us;
Linked Mesh - It is a great deal indeed! Exporting a forest, for example,
wouldn't be better!


*Not Working*
Armature Apply Transform: Still exporting as X -90;
Groups: it is not considering the Group Center, only the scene center.

*Some thoughts*
Custom proprieties is a good addition and I saw Shape Keys are planned to
2.72 version. For me, exporting to Unity, Custom Proprieties will make a
lot of sense with Shape Keys implemented, mainly for facial animation.
Thank you guys again!

*Not Tested Yet*
NLA export list. I saw the document and it looks a great workflow. I will
test it soon.

*Presets*
And, as always, I would like to sugest some presets. Would be great to come
with some presets, like:
Unity - Scale 100, Smoothing Face...
Unity without Animation
Unity Groups
Unreal - Scale 100
Legacy (FBX 6.1)
etc.

I will make more tests and, if you may I, I would like to make more
suggestions further. Blender is the best 3D tool with the best workflow.
Now it is becoming the best tool for ANY workflow, thank to you, guys! Did
I said thank you already? THANK YOU SO MUCH!!

Cheers.


Moraes Jr - aka mangojambo
Animator & 3D Artist
+55 43 88133399 <http://www.oniria.com.br>


On 18 June 2014 12:41, Simon Broggi <simon.broggi at gmail.com> wrote:

> Just changed my Unity installation to automatically use the new exporter.
> To do this change the Tools/Unity-BlenderToFBX.py in the Unity
> installation.
> Here's the edited script that works for me (lines added marked
> with  #changed to use binary fbx exporter) :
>
> blender249 = True
>
> try: import Blender
> except:
> blender249 = False
> import bpy
>
> if blender249:
> try: import export_fbx
> except:
> print('error: export_fbx not found.')
>  Blender.Quit()
> else:
> try:
> import io_scene_fbx.export_fbx
>  import io_scene_fbx.export_fbx_bin #changed to use binary fbx exporter
> except:
> print('error: io_scene_fbx.export_fbx not found.')
>  # This might need to be bpy.Quit()
> raise
>
> # Find the Blender output file
> import os
> outfile = os.getenv("UNITY_BLENDER_EXPORTER_OUTPUT_FILE")
>
> # Do the conversion
> print("Starting blender to FBX conversion " + outfile)
>
> if blender249:
>  mtx4_x90n = Blender.Mathutils.RotationMatrix(-90, 4, 'x')
> export_fbx.write(outfile,
> EXP_OBS_SELECTED=False,
>  EXP_MESH=True,
> EXP_MESH_APPLY_MOD=True,
> EXP_MESH_HQ_NORMALS=True,
>  EXP_ARMATURE=True,
> EXP_LAMP=True,
> EXP_CAMERA=True,
>  EXP_EMPTY=True,
> EXP_IMAGE_COPY=False,
> ANIM_ENABLE=True,
>  ANIM_OPTIMIZE=False,
> ANIM_ACTION_ALL=True,
> GLOBAL_MATRIX=mtx4_x90n)
> else:
> # blender 2.58 or newer
> import math
> from mathutils import Matrix
>  # -90 degrees
> mtx4_x90n = Matrix.Rotation(-math.pi / 2.0, 4, 'X')
>  print("moo")
>  class FakeOp:
> def report(self, tp, msg):
>  print("%s: %s" % (tp, msg))
>  exportObjects = ['ARMATURE', 'EMPTY', 'MESH']
>  minorVersion = bpy.app.version[1];
> if minorVersion <= 58:
>  # 2.58
> io_scene_fbx.export_fbx.save(FakeOp(), bpy.context, filepath=outfile,
> global_matrix=mtx4_x90n,
>  use_selection=False,
> object_types=exportObjects,
> mesh_apply_modifiers=True,
>  ANIM_ENABLE=True,
> ANIM_OPTIMIZE=False,
> ANIM_OPTIMIZE_PRECISSION=6,
>  ANIM_ACTION_ALL=True,
> batch_mode='OFF',
> BATCH_OWN_DIR=False)
>  else:
> # 2.59 and later
> kwargs = io_scene_fbx.export_fbx_bin.defaults_unity3d() #changed to use
> binary fbx exporter
>  io_scene_fbx.export_fbx.save(FakeOp(), bpy.context, filepath=outfile,
> **kwargs)
> # HQ normals are not supported in the current exporter
>
> print("Finished blender to FBX conversion " + outfile)
>
>
> On Fri, Jun 6, 2014 at 3:18 AM, Mitchell Stokes <mogurijin at gmail.com>
> wrote:
>
>>  We have a new binary FBX exporter in Blender thanks to the efforts of
>> Bastien Montagne. You can find more information in this recent
>> code.blender.org post:
>> http://code.blender.org/index.php/2014/06/supporting-game-developers-with-blender-2-71/
>>
>> We've run various tests ourselves, but we'd really like to get feedback
>> from people actually using Blender to create assets for use in engines such
>> as Unity, UDK, UE4, or just about any engine that accepts FBX files. To
>> this end, we highly encourage users to test out recent development builds
>> (found at http://builder.blender.org/) and play around with the new
>> exporter. Use it, abuse it, throw your complicated production files at it,
>> and then let us know what breaks via the bug tracker (
>> https://developer.blender.org/).
>>
>> --Mitchell Stokes
>>
>> _______________________________________________
>> Bf-gamedev mailing list
>> Bf-gamedev at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-gamedev
>>
>>
>
> _______________________________________________
> Bf-gamedev mailing list
> Bf-gamedev at blender.org
> http://lists.blender.org/mailman/listinfo/bf-gamedev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-gamedev/attachments/20140624/46e546bf/attachment.htm 


More information about the Bf-gamedev mailing list