Speeding up fbx/obj export

Hello guys,

right now I try to improve my workflow and to automate some processes. My plan is to create a ton of ambient occlusion maps with substance automation toolkit but to create the maps I need to export a lot of meshes from my blend files first. I created a python script that does this for me very well but I the export takes very very long - for fbx as well as obj (I decided to use fbx since the file size is much smaller than obj).

Since the exporter uses python too and python just uses one core I wonder how to speed up the export process. Each scene has multiple very high poly meshes which I will export as separated fbx files. It would ne convenient to export all objects at once instead after each other.

Is that possible anyhow with python? Is there another fbx/obj exporter that is faster than the blender one?

I appreciate your advise.

Best

EDIT:

I recently noticed that mutliprocessing is possible with python inside of blender but I didn’t figure out how to make use of it for exporting multiple meshes yet.

you would need to write a custom fbx exporter. it could be threaded pretty easily I think, so long as you lock the main thread to prevent blender’s datablocks from changing while you’re processing the existing data. FBX is split into several different sections, which is defined by a table of contents block- the only time a block refers to data written to another block is in the Connections block, where all of the hierarchical connections are made, materials are assigned, etc. You would of course need to write the final file in a single thread, but writing the file is a pretty trivial amount of time spent in the export process compared to gathering and constructing the fbx data.

There was a GSoC 2020 project that made a C++ version of the ,obj exporter. It isn’t available in an official Blender build yet, but if you can compile Blender yourself, you can get it using the branch soc-2020-io-performance.

(I am working on getting this into master, so that it will be in the nightly builds and the 3.0 release of Blender, but it sounds like you need this sooner.)

Thanks for your both responses.

Writing a custom fbx exporter is out of my skill level since I usually don’t use python or c++. It is good to know that it will be available in 3.0.0, but you’re right, I would like to use it sooner. Is it already integrated to 2.9.3 beta or 3.0.0 alpha? Otherwise I would give the soc-2020-io-performance branch a try.

I am working on getting this into master, so that it will be in the nightly builds and the 3.0 release of Blender, but it sounds like you need this sooner.

Is it already included in the 3.0.0 alpha? :slight_smile:

No, sorry.

Orchestrate multiple Blenders for the exports.