FBX Batch Export in Blender 2.8

What I really missing in Blender 2.8 is a built-in batch export in FBX format (or at least addon) - so each selected mesh will be exported in a single file with zero transforms (automatically placed in 0.0.0 before export). If you’re making an environment for the game engine, for example, you have hundreds of constantly updating props and it would be nice to click one button to export all of them in separate files and then click update in a game engine.

Blender 2.79 has a great addon for that (personally using it a lot) - Capsule (https://gumroad.com/l/capsule-blender3d) but looks like the developer isn’t planning to port it to 2.8 in the near future. Another alternative in FBX Bundle plugin, which I didn’t use and which also doesn’t have 2.8 support. Even in Maya, you can use Game Exporter for such purposes.

Maybe there is a similar tool exists in Blender 2.8 but I didn’t hear about it. If so, please tell me. I’m also wondering why in FBX export we have Batch Mode setting, but it only allows to export whole scenes or collections to separate files and not a single meshes.

1 Like

I’m even in favor for adding support for multiple exports and imports, actually.
Not just for FBX, even. I’m really hoping that studios will start adopting a different, more open format eventually. Despide its feature richness FBX has still so many problems even in commercial software outside of the Audodesk universe. :confused:

Aany way … I digress. Yes - I hope this excellent plugin gets ported to 2.8, soon!
https://bitbucket.org/renderhjs/blender-addon-fbx-bundle

3 Likes

to do an extremely rudimentary version of this doesn’t take too much code at all. this just runs from the text editor after you fill in the file destination variable manually. although I’m sure you could spend some time building a UI, and plugging in more explicit export options into the fbx export call.

import bpy

#example path to store files
path = '/Users/Steve/Desktop/'

#store selection
obs = bpy.context.selected_objects
    
for ob in obs:
    #deselect all but just one object and make it active
    bpy.ops.object.select_all(action='DESELECT')
    ob.select_set(state=True)
    bpy.context.view_layer.objects.active = ob
    
    #store object location then zero it out
    location = ob.location.copy()
    bpy.ops.object.location_clear()
    
    #export fbx
    filename = path + ob.name + '.fbx'
    bpy.ops.export_scene.fbx(filepath=filename, use_selection=True)
    
    #restore location
    ob.location = location
  
#reselect originally selected objects  
for ob in obs:
    ob.select_set(state=True)
1 Like

See my add-on (paid)

I am going to add an ability to pass custom parameters to the add-on in upcoming versions. Also a way to export the scene as a whole is planned. I just did not get any request for it.

I am going to make a 2.8 release next week.

so, after posting this I noticed essentially this exact export script already exists built into blender in the templates section of the text editor. whoops. now you know!

The problem with this script is that it doesn’t take in a consideration a lot of things, like Unity/UE4 specific export parameters, Armature, Groups, Animation, Modifiers, etc, and because of that hardly can be used in real production, like Capsule. I think it’s easier to update the existing code base (though it contains thousands of code lines) rather than writing everything again from scratch. In a worst case scenario, when Blender 2.8 will be released and this plugin won’t be updated, I will try to migrate everything by myself (I already did some changes in a local version for 2.79, because of changes in 2.79 export API, but they aren’t such global like moving to 2.8).

I saw only gifs on your post, but it seems like your addon have fewer export features than a free Capsule addon at this moment (I can’t group a couple of objects and export them as single .fbx, no support for UE4/Unity/custom export settings presets, no animation support, etc). But an ability to paste an object into Blender instead of going through import menu is a cool thing though.

Meanwhile, if you like Capsule, write a word on an issue ticket to let the developer know that you need this plugin for 2.8 (probably it won’t change a lot but better than nothing): https://github.com/Takanu/Capsule/issues/14

I will add custom export command line to the next version, so one can override the add-ons predesigned optimized settings. It will be tedious to create massive options panels for each format to be honest.

I designed it to be part of movie type of production where iterative exports are a thing, when the individual assets are exported for different applications. So you set things once, and keep iterating and exporting without setting things up again and again.

At the moment it supports batch exports at the scene level, however no grouping or Unreal presets are supported as you stated, since it was never my intention. It is something I can look into it if there is enough interest for it. I have past gaming production experience, I understand the situation, just that I need to see what the interest level is since developing features takes time really.

Lots of people actually using Blender for game development (guess even more than for movies), so if you’re planning to increase your sales, it’s a good idea to add presets at least for Unity/UE4.

I mean, I threw it together for you in a few minutes out of my own time in case it helped get you started. And I flagged that you’d probably want to update it to support more specific fbx settings for your needs.

Certainly if you’re looking for a robust fully-featured solution it’s going to require some substantial effort on someone’s part. Or actually not that much if you fiddle with the code and customize it a bit for your specific needs.

I have my own script that does exactly that with my customized presets for unity and unreal and automation of placing various assets in the right folders for our project.

I’m always happy to knowledge share but when you respond to free offerings with “this isn’t enough” it kinda dissuades people from wanting to help further.

I need to know what those “presets” are. I have not delved with UE4 and it has been quite sometime since I touch Unity. My gaming work were mostly on custom engines and in those environments we had dedicated programmers for tools developments.

In any case it would be helpful to expand on those presets so I will see if it is something I want to implement. Other than that, like shteeve mentioned, you can probably hack his example to fit to your own needs. Obviously no ui or fancy in it. See the API doc for what options FBX take

https://github.com/Takanu/Capsule/blob/master/Capsule/export_presets.py
I will continue using 2.79 for the environment until a proper solution will be created. If after 2.8 release there won’t be such a solution, I will try to update Capsule on my own.
Thanks for letting me know about your tool. Still hoping for a native solution for batch export.

Ok I will take a look at it.

Did you see this

1 Like

Actually that is my post - I can’t get this to work for me. Probably because i don’t really “get” what is some very basic Blender work/terms… (also the export part does not work for 2.8 yet…, this is why i try to do this without learning 2.79 , as 2.8 is rather different. )

Sure but it seems like it is more under development than the one OP mentioned.

1 Like

according to @helluvamesh the GAYZ tool will be ported to 2.8, when that is stable. As I did not really want to get that much into 2.79, it have been doing that tool in my “trail and error” style… and I think i found some bug - that was fixed. So the developer has been very very helpful… even though I have not be that clever. :wink:

Sorry if i’m not correct, but I’m pretty sure Takanu Kyriako is working on a new version of Capsule for 2.8+. I remember reading an email from him or from gumroad annoucing the development :slight_smile:

2 Likes

The latest email from Gumroad was more than a year ago about Capsule 1.10 Beta. Didn’t receive any other emails from Gumroad about this project and I see zero commits on GitHub repo for a year. Maybe I missed something and he’s really working on it somewhere else (then it’s good news).

1 Like

The best exporter (fastest, almost automatic, batch exporting with a single keystroke) is FBX Bundle for me. Unluckily - still no Blender 2.8 version…