Continuation of https://glitch.com/~aframe-2-vr-menus tile based block editor
Features:
Credits:
This repo is intended to show an example of a complete gltf pipeline from exported gltf file through optimization and screenshot generation and a json file to describe the model library for use in front-end apps.
After running npm install
then run npm run gltf:pipeline
to do the full 3 step process of auditing, building and creating screenshots for your source glTF library.
Or, you can run each script separately in this order:
node gltf-audit.mjs -i ./src/models
- create initial gltf-audit.json outputnode gltf-build.mjs -i ./src/models -o ./dist/models -u
- create optimized glb modelsnode gltf-screenshots.mjs -i ./dist/models -o ./dist/img -u
- create preview images for each glbEach of the 3 scripts above have corresponding npm scripts to be accessed like npm run gltf:audit
, npm run gltf:build
, and npm run gltf:screenshots
. The command npm run gltf:pipeline
simply runs all 3 in that order.
Generates json file with details about gltf or glb files in project ./src/ path
example usage:
$ node gltf-audit -i src
-i is optional to specify a directory to audit
Takes input directory of assets and optimizes each including adding draco compression to an output directory
example usage:
$ node gltf-build -i src -o dist
$ node gltf-build -i src -o dist -u
Create screenshots for all glb files found in input path using the screenshot-glb script.
example usage
$ node gltf-screenshots -i ./dist/ -o ./dist/
$ node gltf-screenshots -i ./dist/ -o ./dist/ -u
example usage:
$ screenshot-glb -i input.glb -o test.png