How to add a callback to gltf exporter

I am relatively new to blender development.

I am working on a geometry clipboard to transfer quickly between Blender, Unreal, Houdini, etc…

The existing gltf exporter is awesome - but I need a way to get the glb binary data and also prevent it from exporting any file. I was hoping to add a callback to it:

bpy.ops.export_scene.gltf(filepath=export_path, export_format=‘GLB’, export_selected=True)

But I am confused how to pass a callback in those parameters (I am able to add bool and string properties)

Thanks for any suggestions/advice on how to best approach this

but I need a way to get the glb binary data and also prevent it from exporting any file. I was hoping to add a callback to it:

Hi, I’ve been developing plugins for a few years, i don’t think a callback on operator is possible currently via blender bpy, alternatively if this operator is written in python, then you could modify directly it’s source file

Thanks BD3D - The gltf exporter is a python addon.

I think the exporter itself is an operator.

type(bpy.ops.export_scene.gltf)
<class ‘bpy.ops._BPyOpsSubModOp’>

Maybe I can just add a special export function to the operator and call it explicitly?
bpy.ops.export_scene.gltf.MyCustomFunc()

or you could place your code ad the end of the execute() function of this operator class

1 Like