项目作者: scurest

项目描述 :
Convert Inter-Quake Models to glTF
高级语言: Python
项目地址: git://github.com/scurest/iqm2glb.git
创建时间: 2019-02-10T11:31:33Z
项目社区:https://github.com/scurest/iqm2glb

开源协议:

下载


Python script to convert Inter-Quake Model .iqm
files to glTF .glb.

Version support: IQM 2; glTF 2.0; GLB 2.

Usage

CLI

  1. python iqm2glb.py INPUT.iqm [OUTPUT.glb]

If OUTPUT.glb is given, it will be over-written.

Python

  1. import iqm2glb
  2. with open('INPUT.iqm', 'rb') as f:
  3. iqm = f.read()
  4. glb = iqm2glb.iqm2glb(iqm)
  5. # glb.gltf contains the JSON
  6. # glb.buffer contains the BIN
  7. # You can modify them now if you like
  8. with open('OUTPUT.glb', 'wb') as f:
  9. glb.write(f)

You can provide options with iqm2glb(iqm, options). Look at DEFAULT_OPTIONS
in the source code for a list of available options.

The converter is a single file with no dependencies outside the standard
library, so just drop it wherever you want it.