Ok cool figured it out for anyone.
Windows bat: (im sure unix people can figure it out based on this)
@echo off
set PATH="C:\Program Files\Blender Foundation\Blender 2.82"
set FILENAME=xxxxx.blend
blender %FILENAME% --background --python blend2gltf.py
pause
and blend2gltf.py:
import bpy
import sys
filePath = bpy.data.filepath+'.gltf'
bpy.ops.export_scene.gltf(filepath=filePath)
I didn’t see the --python
tag before and got stuck, so hopefully this helps someone.
Edit: proper post here Blender to gltf converter as a gradle task (or powershell)