Could i use blender to export model to .fbx format via console?
something like: blender.exe myModel.blend --output model.fbx
Could i use blender to export model to .fbx format via console?
something like: blender.exe myModel.blend --output model.fbx
For Blender 2.90 and up this script will export a scene as an FBX file for you.
export_fbx.py:
import bpy
import sys
print("Blender export scene in FBX Format in file "+sys.argv[-1])
# Doc can be found here: https://docs.blender.org/api/current/bpy.ops.export_scene.html
bpy.ops.export_scene.fbx(filepath=sys.argv[-1])
To invoke it with blender you can use the following command:
blender <your_scene>.blend --background --python export_fbx.py -- <your_scene>.fbx
The python script is the minimum you can get away with for exporting your scene. There are a lot of parameters you can pass to the export_scene.fbx()
function and it does not handle mutliple input and output files.
The answer is yes, you could, but in non-trivial way. What i mean by that, is, as it says here in Python Options, you can execute python script (as file, or as passed string) from a command line. Example:
blender --background --python myscript.py
Your script will be executed in --background
mode - that means without even opening Blender GUI. So you can use Blender as import-export module. Basically you can use anything that is in bpy
module in such a way. Have a nice time!
EDIT
something like: blender.exe myModel.blend --output model.fbx
Link, that i have provided, also contains all other command line options for Blender. At least i haven't found direct import-export option here. So i think you will anyway need to write python script.