Batch Export for different formats using bpy.ops.export_scene

The blender 2.81 template is a nifty set of code but it looks like the only supported formats are FBX, x3d, obj, and gltf. The template uses byp.ops.export_scene :

How would i access other exporters such as .chan? since bpy.ops.export_scene.chan does not work

I’m trying to export a batch of .chan (Nuke) files because i want animation data in ascii format in a different file for each object in a scene.

Looks like there are similar questions for other formats that are less popular as well such as DXF, 3DS, ASE, so i think a generic answer where any import/export addon can be figured out would be most useful.


If anyone is running into similar things check out the __ init file in the addon folder and look for something similar to this for your file exporter:

class ExportChan(Operator, ExportHelper):
    """Export the animation to .chan file, readable by nuke and houdini """ \
    """(the exporter uses frames from the frames range)"""
    bl_idname = "export.export_chan"
    bl_label = "Export chan file"

    filename_ext = ".chan"
    filter_glob: StringProperty(default="*.chan", options={'HIDDEN'})
    y_up: BoolProperty(
            name="Make Y up",
            description="Switch the Y and Z axis",
    rotation_order: rotation_order

    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        from . import export_nuke_chan
        return export_nuke_chan.save_chan(context,

So for Nuke (.chan) files it is bpy.ops.export.export_chan(filepath=fn + “.chan”)
you can also set the y_up and rotation_order.

The final script for batch exporting Nuke (.chan) fils is:

# exports each selected object into its own file

import bpy
import os

# export to blend file location
basedir = os.path.dirname(

if not basedir:
    raise Exception("Blend file is not saved")

view_layer = bpy.context.view_layer

obj_active =
selection = bpy.context.selected_objects


for obj in selection:


    # some exporters only use the active object = obj

    name = bpy.path.clean_name(
    fn = os.path.join(basedir, name)

    # Can be used for multiple formats
    # bpy.ops.export_scene.x3d(filepath=fn + ".x3d", use_selection=True)
    # bpy.ops.export_scene.fbx(filepath=fn + ".fbx", use_selection=True)
    bpy.ops.export.export_chan(filepath=fn + ".chan")


    print("written:", fn) = obj_active

for obj in selection: