gltf-transform
#glTF
https://gyazo.com/c41b5fb8357d238907101e55cca62728
Don McCurdy先生謹製のTypeScript製glTF読み書きライブラリ
https://gltf-transform.donmccurdy.com/
使い方
型定義だけ利用する
@pixiv/three-vrmではこの使い方
せっかくモノレポ構成なので、型定義だけ別レポジトリにしてもいいような気はするよね
code:ts
import { GLTF as GLTFSchema } from '@gltf-transform/core';
const json = something.json as GLTFSchema.IGLTF;
ファイルを利用した読み書き
code:ts
import { WebIO } from '@gltf-transform/core';
const io = new WebIO( { credentials: 'include' } );
const doc = await io.read( 'path/to/model.glb' );
const docBinary = await io.readBinary( glbArrayBuffer );
const glb = await io.writeBinary( newDoc );