0
$\begingroup$

is it possible that can we run our python script when we hit the export button in a blender, please share some resources and links for this, just want to run my script after that or any other way to run this? Thanks for your time.

$\endgroup$

1 Answer 1

0
$\begingroup$

Your question is tagged glTF so I'll write my answer specifically for glTF (and I suspect the answer is "no" for most other formats, although you can certainly add a whole new export format using a Python script).

The Blender glTF exporter has third-party Python hooks for various export features, documented here:

https://github.com/KhronosGroup/glTF-Blender-IO/tree/master/example-addons/example_gltf_exporter_extension

Note however, these are intended to supply third-party glTF extensions into the exported file. There's not a generic "run this script" that can supersede the entire glTF export process from the same export button, but there are "gather" hooks that are likely to be called at various times during export to look for needed extensions that should be included in the exported file.

One in particular, called gather_gltf_extensions_hook, runs once for the root of the file, so this may be the closest to what you're asking for here.

$\endgroup$
1
  • $\begingroup$ I copied that script and pasted it into the blender, but nothing happened. How to run that? $\endgroup$ Commented May 4, 2022 at 3:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .