I’m using a Python script to run Blender’s FBX exporter, but I only want to export certain objects.
The FBX exporter has an option to only export selected objects, so I want to have only the Armature and one mesh selected when I call bpy.ops.export_scene.fbx().
I’m invoking my script from the command line like so: blender model.blend --python animation-export.py
But whatever I try, I get errors like “context is incorrect”, or that there is no bpy.context.scene or bpy.context.active.
Can anyone give me an example of how to select 1) the first Armature in my scene and 2) a mesh by name from Python?
I’ve uploaded my current, incomplete, Python script to PasteBin: animation-export.py