From bcd52cc4ba5f333b2999a58f67cc05ddf28b4fb1 Mon Sep 17 00:00:00 2001
From: Alexey Knyazev <3479527+lexaknyazev@users.noreply.github.com>
Date: Tue, 22 Oct 2024 12:01:47 +0400
Subject: [PATCH] Version 2.0.0-dev.3.10 (#240)
---
CHANGELOG.md | 40 ++++++++
README.md | 67 ++++++++++---
pubspec.yaml | 24 ++---
web/scripts/prism.js | 2 +-
web/styles/prism.css | 221 +------------------------------------------
5 files changed, 108 insertions(+), 246 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 52438ba9..76e25ede 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,45 @@
# Changelog
+## 2.0.0-dev.3.10
+
+### New Features
+
+* Added support for `KHR_materials_anisotropy` extension.
+ * Added `KHR_MATERIALS_ANISOTROPY_ANISOTROPY_TEXTURE_TEXCOORD` validation warning.
+
+* Added support for `KHR_materials_dispersion` extension.
+ * Added `KHR_MATERIALS_DISPERSION_NO_VOLUME` validation warning.
+
+* Added new tangent space validations: `MESH_PRIMITIVE_NO_TANGENT_SPACE` validation error and `MESH_PRIMITIVE_GENERATED_TANGENT_SPACE` validation warning.
+
+* Added new `KHR_MATERIALS_CLEARCOAT_CLEARCOAT_NORMAL_TEXTURE_TEXCOORD` validation warning.
+
+* Added partial support for the `KHR_animation_pointer` extension.
+ * Added new `KHR_ANIMATION_POINTER_ANIMATION_CHANNEL_TARGET_NODE` and `KHR_ANIMATION_POINTER_ANIMATION_CHANNEL_TARGET_PATH` validation errors.
+ * Added new `INCOMPLETE_EXTENSION_SUPPORT` validation info.
+
+* Web version now supports external resources in directories.
+
+### Changes
+
+* Removed `UNRESERVED_EXTENSION_PREFIX` validation warning.
+
+* Removed `KHR_MATERIALS_IRIDESCENCE_THICKNESS_RANGE_INVALID` validation error following the spec update.
+
+### Bugfixes
+
+* Fixed incorrect errors when an indexed attribute, e.g., `COLOR_0`, is used in morph targets (#178, #213).
+
+* Fixed incorrect errors in the Web version when an asset contains non-relative URIs (#229).
+
+* Fixed crash when skin weights data is missing (#196).
+
+### Integration updates
+
+* The `validateBytes` JS API function now supports a `format` validation option to bypass format detection and force GLB or glTF JSON explicitly.
+
+* Added an option to ignore all validation issues except those passed explicitly; supported in both JS API and YAML config file.
+
## 2.0.0-dev.3.9
### Bugfixes
diff --git a/README.md b/README.md
index 3b591bcd..91669ea0 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
+# glTF-Validator
+
-
+
-# glTF-Validator
-
[![Build Status](https://github.com/KhronosGroup/glTF-Validator/workflows/CI/badge.svg)](https://github.com/KhronosGroup/glTF-Validator/actions?query=workflow%3ACI)
Tool to validate [glTF](https://github.com/KhronosGroup/glTF) assets.
@@ -24,7 +24,7 @@ NuGet package [Third-party contribution]: https://www.nuget.org/packages/GltfVal
- Asset description validation
- All properties and their types from JSON-Schemas (including implicit limitations on valid values).
- Validity and compatibility of internal references.
- - Correctness of `Data URI` encoding.
+ - Correctness of Data URI encoding.
- Binary buffers validation
- Forbidden or incorrect accessor values (e.g., `NaN`, invalid quaternions, indecomposable matrices, etc).
- `accessor.min` and `accessor.max` values.
@@ -58,8 +58,9 @@ NuGet package [Third-party contribution]: https://www.nuget.org/packages/GltfVal
You can use hosted [web front-end tool](https://github.khronos.org/glTF-Validator). It works completely in the browser without any server-side processing.
-#### Command Line Tool Usage
-```
+### Command Line Tool Usage
+
+```text
Usage: gltf_validator []
Validation report will be written to `.report.json`.
@@ -82,48 +83,86 @@ Shell return code will be non-zero if at least one error was found.
## Building
### Prerequisites
+
1. Download and install [Dart SDK](https://dart.dev/tools/sdk/archive) for your platform.
-2. Add Dart SDK `bin` folder to your PATH.
-3. From the repository root folder, run `dart pub get` to get dependencies.
+2. Add Dart SDK `bin` directory to your PATH.
+3. From the repository root directory, run `dart pub get` to get dependencies.
#### Fetching dependencies from behind a corporate firewall
+
`dart pub get` downloads dependencies from Google's `pub.dev` server over HTTPS. If you need to specify a proxy, follow these steps:
+
1. Set `https_proxy` or `HTTPS_PROXY` environment variable in form `hostname:port`.
2. If the proxy requires credentials, use this syntax: `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.
+
1. Save your corporate self-signed root certificate as X.509 file.
2. (Linux only) Try to add your cert to `/etc/pki/tls/certs/ca-bundle.crt` or `/etc/ssl/certs`.
3. If that doesn't work or if you're on Windows, add environment variable `DART_VM_OPTIONS` with value `--root-certs-file=`.
After doing this, `dart pub get` should be able to download dependencies successfully.
+#### Clearing Caches
+
+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:
+
+1. Remove the `.dart_tool` directory and the `pubspec.lock` file from the project root directory.
+2. Run `dart pub cache clean --force`.
+3. Run `dart pub get`.
+
### Drag-n-Drop Web Tool
-To build a drag-n-drop online validation tool (as hosted [here](https://github.khronos.org/glTF-Validator/)), follow these steps after installation:
+
+To build the drag-n-drop online validation tool (as hosted [here](https://github.khronos.org/glTF-Validator/)), follow these steps after installation:
+
1. Run `dart run grinder web`.
2. All needed files will be written to `build/web` directory.
+To build and package the drag-n-drop online validation tool, follow these steps after installation:
+
+1. Run `dart run grinder web-archive`.
+2. An archive will be written to the `build/gltf_validator-VERSION-web.zip` file.
+
### CLI tool
+
+To build the CLI tool, follow these steps after installation:
+
1. Run `dart run grinder exe`.
-2. Native executable file will be written to `build/bin/gltf_validator` or `build/bin/gltf_validator.exe`.
+2. Native executable file will be written to `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:
+
+1. Run `dart run grinder exe-archive`.
+2. An archive will be written to the `build/gltf_validator-VERSION-PLATFORM.tar.xz` (Linux and macOS) or `build/gltf_validator-VERSION-PLATFORM.zip` (Windows) file.
### NPM Package
+
To build an npm package for use in Node.js environment, follow these steps after installation:
+
1. Run `dart run grinder npm`.
2. `gltf-validator` npm package will be written to `build/node`.
Refer to the [npm package documentation](https://www.npmjs.com/package/gltf-validator) for additional information.
#### Publishing
+
To publish an npm package, follow these steps after installation:
+
1. Run `dart run grinder npm-publish`.
2. `gltf-validator` npm package will be built to `build/node` and published to npm registry using `npm publish`.
-### Post-Build Steps
-1. To auto-format all source files, from the root folder run: `dart format --fix .`
-2. To run the tests, use: `dart test`
-
### Validation Issues List
+
To generate [ISSUES.md](ISSUES.md), follow these steps after installation:
+
1. Run `dart run grinder issues`.
2. `ISSUES.md` file will be written to the repo root.
+
+## Contributing
+
+Before making a pull request do the following steps:
+
+1. Run `dart format .` (note the dot) to format all source files.
+2. Run `dart analyze` to check that there are no analyzer issues.
+3. Run `dart test` to check that the tests pass.
+4. Run `dart run grinder all` to check that all targets build.
diff --git a/pubspec.yaml b/pubspec.yaml
index 4a3b6791..b6163b50 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -4,22 +4,22 @@ description: Library for loading and validating glTF 2.0 assets
homepage: https://github.com/KhronosGroup/glTF-Validator
dependencies:
- args: '^2.3.1'
+ args: '^2.4.2'
isolate: '^2.1.1'
- meta: '^1.8.0'
- path: '^1.8.2'
- vector_math: '^2.1.2'
- yaml: '^3.1.1'
+ meta: '^1.16.0'
+ path: '^1.8.3'
+ vector_math: '^2.1.4'
+ yaml: '^3.1.2'
dev_dependencies:
- archive: '^3.3.0'
- build_runner: '^2.1.11'
+ archive: '^3.4.10'
+ build_runner: '^2.3.3'
build_version: '^2.1.1'
- build_web_compilers: '^3.2.3'
- grinder: '^0.9.1'
- js: '^0.6.4'
- node_preamble: '^2.0.1'
- test: '^1.21.2'
+ build_web_compilers: '^3.2.7'
+ grinder: '^0.9.4'
+ js: '^0.6.7'
+ node_preamble: '^2.0.2'
+ test: '^1.24.3'
environment:
sdk: '>=2.11.99 <3.0.0'
diff --git a/web/scripts/prism.js b/web/scripts/prism.js
index 57adf18f..60b384f0 100644
--- a/web/scripts/prism.js
+++ b/web/scripts/prism.js
@@ -1,4 +1,4 @@
-/* PrismJS 1.27.0
+/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism-coy&languages=json */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""+i.tag+">"},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;
diff --git a/web/styles/prism.css b/web/styles/prism.css
index fc642709..b86676ad 100644
--- a/web/styles/prism.css
+++ b/web/styles/prism.css
@@ -1,220 +1,3 @@
-/* PrismJS 1.27.0
+/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism-coy&languages=json */
-/**
- * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
- * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
- * @author Tim Shedor
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: black;
- background: none;
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
- font-size: 1em;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
- line-height: 1.5;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- position: relative;
- margin: .5em 0;
- overflow: visible;
- padding: 1px;
-}
-pre[class*="language-"] > code {
- position: relative;
- z-index: 1;
- border-left: 10px solid #358ccb;
- box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
- background-color: #fdfdfd;
- background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
- background-size: 3em 3em;
- background-origin: content-box;
- background-attachment: local;
-}
-
-code[class*="language-"] {
- max-height: inherit;
- height: inherit;
- padding: 0 1em;
- display: block;
- overflow: auto;
-}
-
-/* Margin bottom to accommodate shadow */
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background-color: #fdfdfd;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- margin-bottom: 1em;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- position: relative;
- padding: .2em;
- border-radius: 0.3em;
- color: #c92c2c;
- border: 1px solid rgba(0, 0, 0, 0.1);
- display: inline;
- white-space: normal;
-}
-
-pre[class*="language-"]:before,
-pre[class*="language-"]:after {
- content: '';
- display: block;
- position: absolute;
- bottom: 0.75em;
- left: 0.18em;
- width: 40%;
- height: 20%;
- max-height: 13em;
- box-shadow: 0px 13px 8px #979797;
- -webkit-transform: rotate(-2deg);
- -moz-transform: rotate(-2deg);
- -ms-transform: rotate(-2deg);
- -o-transform: rotate(-2deg);
- transform: rotate(-2deg);
-}
-
-pre[class*="language-"]:after {
- right: 0.75em;
- left: auto;
- -webkit-transform: rotate(2deg);
- -moz-transform: rotate(2deg);
- -ms-transform: rotate(2deg);
- -o-transform: rotate(2deg);
- transform: rotate(2deg);
-}
-
-.token.comment,
-.token.block-comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: #7D8B99;
-}
-
-.token.punctuation {
- color: #5F6364;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number,
-.token.function-name,
-.token.constant,
-.token.symbol,
-.token.deleted {
- color: #c92c2c;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.function,
-.token.builtin,
-.token.inserted {
- color: #2f9c0a;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.token.variable {
- color: #a67f59;
- background: rgba(255, 255, 255, 0.5);
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword,
-.token.class-name {
- color: #1990b8;
-}
-
-.token.regex,
-.token.important {
- color: #e90;
-}
-
-.language-css .token.string,
-.style .token.string {
- color: #a67f59;
- background: rgba(255, 255, 255, 0.5);
-}
-
-.token.important {
- font-weight: normal;
-}
-
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
-.token.namespace {
- opacity: .7;
-}
-
-@media screen and (max-width: 767px) {
- pre[class*="language-"]:before,
- pre[class*="language-"]:after {
- bottom: 14px;
- box-shadow: none;
- }
-
-}
-
-/* Plugin styles: Line Numbers */
-pre[class*="language-"].line-numbers.line-numbers {
- padding-left: 0;
-}
-
-pre[class*="language-"].line-numbers.line-numbers code {
- padding-left: 3.8em;
-}
-
-pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
- left: 0;
-}
-
-/* Plugin styles: Line Highlight */
-pre[class*="language-"][data-line] {
- padding-top: 0;
- padding-bottom: 0;
- padding-left: 0;
-}
-pre[data-line] code {
- position: relative;
- padding-left: 4em;
-}
-pre .line-highlight {
- margin-top: 0;
-}
+code[class*=language-],pre[class*=language-]{color:#000;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{position:relative;margin:.5em 0;overflow:visible;padding:1px}pre[class*=language-]>code{position:relative;z-index:1;border-left:10px solid #358ccb;box-shadow:-1px 0 0 0 #358ccb,0 0 0 1px #dfdfdf;background-color:#fdfdfd;background-image:linear-gradient(transparent 50%,rgba(69,142,209,.04) 50%);background-size:3em 3em;background-origin:content-box;background-attachment:local}code[class*=language-]{max-height:inherit;height:inherit;padding:0 1em;display:block;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdfdfd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:1em}:not(pre)>code[class*=language-]{position:relative;padding:.2em;border-radius:.3em;color:#c92c2c;border:1px solid rgba(0,0,0,.1);display:inline;white-space:normal}pre[class*=language-]:after,pre[class*=language-]:before{content:'';display:block;position:absolute;bottom:.75em;left:.18em;width:40%;height:20%;max-height:13em;box-shadow:0 13px 8px #979797;-webkit-transform:rotate(-2deg);-moz-transform:rotate(-2deg);-ms-transform:rotate(-2deg);-o-transform:rotate(-2deg);transform:rotate(-2deg)}pre[class*=language-]:after{right:.75em;left:auto;-webkit-transform:rotate(2deg);-moz-transform:rotate(2deg);-ms-transform:rotate(2deg);-o-transform:rotate(2deg);transform:rotate(2deg)}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#7d8b99}.token.punctuation{color:#5f6364}.token.boolean,.token.constant,.token.deleted,.token.function-name,.token.number,.token.property,.token.symbol,.token.tag{color:#c92c2c}.token.attr-name,.token.builtin,.token.char,.token.function,.token.inserted,.token.selector,.token.string{color:#2f9c0a}.token.entity,.token.operator,.token.url,.token.variable{color:#a67f59;background:rgba(255,255,255,.5)}.token.atrule,.token.attr-value,.token.class-name,.token.keyword{color:#1990b8}.token.important,.token.regex{color:#e90}.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,.5)}.token.important{font-weight:400}.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.namespace{opacity:.7}@media screen and (max-width:767px){pre[class*=language-]:after,pre[class*=language-]:before{bottom:14px;box-shadow:none}}pre[class*=language-].line-numbers.line-numbers{padding-left:0}pre[class*=language-].line-numbers.line-numbers code{padding-left:3.8em}pre[class*=language-].line-numbers.line-numbers .line-numbers-rows{left:0}pre[class*=language-][data-line]{padding-top:0;padding-bottom:0;padding-left:0}pre[data-line] code{position:relative;padding-left:4em}pre .line-highlight{margin-top:0}