Skip to content

Instantly share code, notes, and snippets.

@tzmartin
Last active August 9, 2023 05:29
Show Gist options
  • Save tzmartin/5f73f53be31365c0c6f3c56bda577c39 to your computer and use it in GitHub Desktop.
Save tzmartin/5f73f53be31365c0c6f3c56bda577c39 to your computer and use it in GitHub Desktop.
Convert USDZ to GLB via Python

Convert USDZ to GLB (python)

Install

pip install aspose-3d

Run

python usdz2glb.py ./test.usdz test.glb

Output

File created:  True
import sys
import os.path
import aspose.threed as a3d
def usdz2glb(usdzFilePath, glbFileName):
scene = a3d.Scene.from_file(usdzFilePath)
scene.save(glbFileName)
file_exits = os.path.exists(glbFileName)
print('File created: ', file_exits,end='\n')
sys.stdout.flush()
if __name__ == '__main__':
usdz2glb(sys.argv[1], sys.argv[2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment