Tool to validate glTF assets.
Validation is performed against glTF 2.0 specification.
Validator writes a validation report (in JSON-format) with all found issues and asset stats.
Live drag-n-drop tool: https://github.khronos.org/glTF-Validator
NPM package: https://www.npmjs.com/package/gltf-validator
NuGet package [Third-party contribution]: https://www.nuget.org/packages/GltfValidator/
NaN
, invalid quaternions, indecomposable matrices, etc).accessor.min
and accessor.max
values.You can use hosted web front-end tool. It works completely in the browser without any server-side processing.
Usage: gltf_validator [<options>] <input>
Validation report will be written to `<asset_filename>.report.json`.
If <input> is a directory, validation reports will be recursively created for each *.gltf or *.glb asset.
Validation log will be printed to stderr.
Shell return code will be non-zero if at least one error was found.
-o, --[no-]stdout Print JSON report to stdout instead of writing it to a file. This option cannot be used with directory input.
-r, --[no-]validate-resources Validate contents of embedded and/or referenced resources (buffers, images).
(defaults to on)
-t, --[no-]write-timestamp Write UTC timestamp to the validation report.
-p, --[no-]absolute-path Write absolute asset path to the validation report.
-m, --[no-]messages Print issue messages to stderr. Otherwise, only total number of issues will be printed.
-a, --[no-]all Print all issue messages to stderr. Otherwise, only errors will be printed. Implies --messages.
-c, --config YAML configuration file with validation options. See docs/config-example.yaml for details.
-h, --threads The number of threads for directory validation. Set to 0 (default) for auto selection.
bin
directory to your PATH.dart pub get
to get dependencies.dart pub get
downloads dependencies from Google's pub.dev
server over HTTPS. If you need to specify a proxy, follow these steps:
https_proxy
or HTTPS_PROXY
environment variable in form hostname:port
.username:password@hostname:port
.dart pub get
validates server's SSL certificate. If your corporate network interferes with SSL connections, follow these steps to get it running.
/etc/pki/tls/certs/ca-bundle.crt
or /etc/ssl/certs
.DART_VM_OPTIONS
with value --root-certs-file=<cert_file>
.After doing this, dart pub get
should be able to download dependencies successfully.
In rare cases, you may encounter various build issues usually caused by previously cached artifacts and/or packages. To clear all caches and re-download the dependencies, do the following steps:
.dart_tool
directory and the pubspec.lock
file from the project root directory.dart pub cache clean --force
.dart pub get
.To build the drag-n-drop online validation tool (as hosted here), follow these steps after installation:
dart run grinder web
.build/web
directory.To build and package the drag-n-drop online validation tool, follow these steps after installation:
dart run grinder web-archive
.build/gltf_validator-VERSION-web.zip
file.To build the CLI tool, follow these steps after installation:
dart run grinder exe
.build/bin/gltf_validator
(Linux and macOS) or build/bin/gltf_validator.exe
(Windows).To build and package the CLI tool, follow these steps after installation:
dart run grinder exe-archive
.build/gltf_validator-VERSION-PLATFORM.tar.xz
(Linux and macOS) or build/gltf_validator-VERSION-PLATFORM.zip
(Windows) file.To build an npm package for use in Node.js environment, follow these steps after installation:
dart run grinder npm
.gltf-validator
npm package will be written to build/node
.Refer to the npm package documentation for additional information.
To publish an npm package, follow these steps after installation:
dart run grinder npm-publish
.gltf-validator
npm package will be built to build/node
and published to npm registry using npm publish
.To generate ISSUES.md, follow these steps after installation:
dart run grinder issues
.ISSUES.md
file will be written to the repo root.Before making a pull request do the following steps:
dart format .
(note the dot) to format all source files.dart analyze
to check that there are no analyzer issues.dart test
to check that the tests pass.dart run grinder all
to check that all targets build.