FBX importer, included in blender, ready for testing

The other question i had was is there a way of baking out the object parenting on import?.. i am loading up an fbx which is giving me 1000’s of emptys (import from navisworks).

Thanks again for your development! this will save us a HUGE amount of time (before we had to go through a seperate program like rhino to import fbx’s.

Thanks, now my FBX export from UDK opens just fine in Blender. Workflow saver indeed! Now all I need are some import parameters I can save as a profile and I’ll be set.

@doublebishop, support for all sorts of options like this is not especially hard to add, but I really rather focus on correct imports for 2.69 release targets - if file contains 1000’s of empties … for now Im afraid this is what you will get.
If you think it may be some error (like null objects used when they shouldnt be), I could check on a test file. But if other apps also load these empties, likely its behaving as it should.

@JWise, enabled presets for importer. r4684.

@ideasman42, r4684 works beautiful. With a scale of .02 it comes in as the original size I exported it as. Now how about the ability to save that preset?

Fair enough, I am just making suggestions that would help us out right now as we are on a project which requires FBX importing… so this importer / your recent fixes have come at a great time for us.

all i can say is that our recent navisworks & revit tests have all passed fine… I am pretty sure the extreme amounts of empties is not an error… these CAD programs usually do funky stuff when doing exports… I have a feeling it is the grouping & sub grouping system in navisworks which creates these empties…

I’ll keep an eye out on the extensions cvs mailing list & these boards for new developments, thanks again for this plugin!

@JWise, presets are saved automatic.

@doublebishop, skipping empties which have no children is quite straightforward.

The reason I rather not add this now is that the empty may have children that rely on the parents transformation,
so! - you may want to pull in parent/child hierarchy - then remove some objects in that hierarchy but maintain transforms. … it can be done but starts to get a bit messy.

Doing this as a post process should be fairly simple though.

One liner in the python terminal (note, this is not optimal, for heavy scenes a more comprehensive script would be better)

[C.scene.objects.unlink(o) for o in C.scene.objects if o.select and o.type == 'EMPTY' and not o.children]

Edit, added support for fbx’s property-templates, r4685. fixed bug in loading bumpmap with blender-internal.

I understand why its needed… I just cant understand why autodesk have done it the way they have for navisworks exports… all the origins are at 0,0,0… all empties are at 0,0,0… so for these imports i am doing, the parent / child relationship doesnt really matter.

I think the reason why its taking ages to import at the moment is that there are probably a million objects trying to import… blender seems to slow down above 10k or so… so yeh i’ll let it run and then optimize at the end.

I may look into modifying your import scripts tonight if i get time… but yeh dont worry about this specific edge case… majority of the time people wont be dealing with these rediculous files.

I found all the model I imported from fbx is smooth shading, is that the way currently handling smooth group?

@ideasman42, I want to set my default FBX format to Y Forward, Z up, Scale 0.02. I tried making those settings my default by saving the startup.blend file and it’s a no-go. So I can’t save “my preset.”

@davyzhang, all models are currently smooth, importing smoothing is on my TODO list.

Could you upload a example FBX which contains smooth/flag shaded faces with an image of how it should look?

@JWise, presets save, but you can’t save the default (you will need to select your preset every time)… this is the same for all operator presets, known limitation but could be supported.

Campbell, I’ll ask again since you must have overlooked my question in the previous post. I’m wondering when the support for armatures will be implemented. I realize that it isn’t particularly high on the priority list, but it would still be interesting to know.

here’s the fbx file https://www.dropbox.com/s/yhqiwq427zs6xcy/smoothflat.FBX
and it should looks like: https://www.dropbox.com/s/x8bpf0x87lfx5o5/smoothflat.png

I also tried to import a .fbx coming from UDK (v10897). The model has 2 materials and 2 UV channels.
The geometry itself and scale is just fine (there are edge breaks along UV seams but that’s UDKs fault). However UVs are missing for both channels.
Regarding multiple materials, I know they are not supported but blender is at least showing both materials with correct names.

Screenshot: http://www.abload.de/img/palmfbxuvs01via8h.png

FBX File:


Palm_01_UDKExport.zip (48.3 KB)

Yes I can’t imagine you haven’t tested it, I just tried to do something to fix my tests with my primitive python knowledge! I had a strong feeling it was not the way to do it :slight_smile:

Thank you for working on this.

Added support for multiple materials per mesh and multiple named UV layers.
Commit: http://markmail.org/message/lviik7v2zrkn2e5i
Blender r59324. is needed.

Note that each material isn’t using the different UV layer yet, so support for that still needs to be added.

@davyzhang, Blender doesn’t support per-face-corner normals, so this kind of smoothing wont be supported. fbx does however support smooth groups IIRC and per face/edge smoothing values, so those could be loaded.

While reading normals and translating them to smooth/flat is possible, not sure its really that good to add… would be very slow to calculate and not work in all cases.

I don’t have a schedule for any further improvements, just add when I get time… bug tracker is ~200 so I should really spend time on that :S. But this isn’t that complicated, perhaps other py devs are able to help with the development too.

at least I know the lamp and camera are flipped, I’ve downloaded the files, will try check on them sometime this week.

Thanks so much for your time for this, it really important to save time for light map rendering or other functions related to light.

blender change shading mode by using vertex normal or mesh normal, I don’t know how 3dsmax implemented this. I just put my wild guess here:

Parse the fbx file find faces using flat shading (without smooth groups),
Import the model in blender as now (default using smooth shading),
Find the faces, (might need to go to edit mode and select the flat faces first )and using bpy.ops.mesh.faces_shade_flat() to flat them

I tested on my blender 2.68.2, select the faces in blender,and run bpy.ops.mesh.faces_shade_flat() in console will flat the faces

blender’s flat and smooth is only different by using face normal or vertex normal to render, but I don’t really found where to set using them, if there’s an attribute to set which normal to use when rendering would be very nice to solve these problem.

here’s the same effect blender can do:

here is the blender file to achieve the same effect:

Eventually its going to have to happen though as its a major part of the game asset workflow and if the linkage between valve’s steam/steamworkship is going to happen some priority should be given to making sure we can import and export smooth and flat edges. On the polycount forums, we start seeing discussions form in which artist at established studios start saying they cant get the studio to adopt Blender because such features are not present.

@SaintHaven, committed, you can now import and export smooth and flat edges, faces.


Well then, this calls for a celebration.

Another thought about smooth group, in my personal practices of game making. I found seldom need for same object using two different shading method. I made the previous object just for test, not for production.

This leads me to another solution. Why not smooth/flat the whole object when import. I can request my art colleague not to us half smooth half flat shading in same object, which really seldom happened even in my normal work pipeline.

so I don’t if that makes the work simpler or not