@forgeax/engine-gltf 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/dist/bridge.d.ts +7 -0
- package/dist/bridge.d.ts.map +1 -1
- package/dist/cli-gltf.d.ts.map +1 -1
- package/dist/cli-gltf.mjs +19 -17
- package/dist/cli-gltf.mjs.map +1 -1
- package/dist/gltf-importer.d.ts.map +1 -1
- package/dist/importer-entry.mjs +47 -21
- package/dist/importer-entry.mjs.map +1 -1
- package/dist/index.mjs +47 -21
- package/dist/index.mjs.map +1 -1
- package/dist/node-file-entry.mjs +9 -7
- package/dist/node-file-entry.mjs.map +1 -1
- package/dist/parse-gltf.d.ts.map +1 -1
- package/dist/parse-skin.d.ts +8 -16
- package/dist/parse-skin.d.ts.map +1 -1
- package/package.json +13 -16
- package/src/__tests__/bridge.unit.test.ts +70 -51
- package/src/__tests__/cli-gltf.integration.test.ts +1 -1
- package/src/__tests__/gltf.unit.test.ts +96 -16
- package/src/__tests__/morph-import.integration.test.ts +1 -1
- package/src/bridge.ts +34 -10
- package/src/cli-gltf.ts +16 -18
- package/src/errors.ts +3 -3
- package/src/gltf-importer.ts +29 -11
- package/src/parse-gltf.ts +5 -0
- package/src/parse-skin.ts +14 -41
package/dist/node-file-entry.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { err, ok, ImportError, IMPORT_ERROR_HINTS } from '@forgeax/engine-types';
|
|
1
|
+
import { err, ok, ImportError, IMPORT_ERROR_HINTS, parseConservativeAnimatedBounds } from '@forgeax/engine-types';
|
|
2
2
|
import { vec3, quat, mat4 } from '@forgeax/engine-math';
|
|
3
3
|
import { deriveAnimationTargetId } from '@forgeax/engine-animation/target-id';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ var GLTF_MESHOPT_FILTERS = ["NONE", "OCTAHEDRAL", "QUATERNION", "EXPONENTIAL"];
|
|
|
8
8
|
var gltfErrorPolicy = {
|
|
9
9
|
"gltf-malformed-header": {
|
|
10
10
|
expected: "GLB 12-byte header (magic 0x46546C67 + version=2 + length) plus mandatory JSON chunk",
|
|
11
|
-
hint: "verify .glb is not truncated; rerun: forgeax
|
|
11
|
+
hint: "verify .glb is not truncated; rerun: forgeax asset import <path> --root <project> --json"
|
|
12
12
|
},
|
|
13
13
|
"gltf-version-unsupported": {
|
|
14
14
|
expected: 'asset.version === "2.0"',
|
|
@@ -44,7 +44,7 @@ var gltfErrorPolicy = {
|
|
|
44
44
|
},
|
|
45
45
|
"gltf-meta-missing": {
|
|
46
46
|
expected: "sidecar <source>.meta.json (importer: 'gltf') present in same directory",
|
|
47
|
-
hint: "run: forgeax
|
|
47
|
+
hint: "run: forgeax asset import <path> --root <project> --json"
|
|
48
48
|
},
|
|
49
49
|
"gltf-instancing-count-mismatch": {
|
|
50
50
|
expected: "all instance attribute accessors share the same count",
|
|
@@ -72,7 +72,7 @@ var gltfErrorPolicy = {
|
|
|
72
72
|
},
|
|
73
73
|
"gltf-image-extract-failed": {
|
|
74
74
|
expected: "image bytes extractable from bufferView / data-URI / external URI without corruption",
|
|
75
|
-
hint: "verify the bufferView byte range / data: URI base64 / external URI sibling file is intact next to the .gltf source; rerun: forgeax
|
|
75
|
+
hint: "verify the bufferView byte range / data: URI base64 / external URI sibling file is intact next to the .gltf source; rerun: forgeax asset import <path> --root <project> --json"
|
|
76
76
|
},
|
|
77
77
|
"gltf-skin-attr-asymmetric": {
|
|
78
78
|
expected: "mesh primitive declares JOINTS_0 and WEIGHTS_0 symmetrically (both present or both absent)",
|
|
@@ -1292,8 +1292,6 @@ function parseGlbChunks(buffer, filePath) {
|
|
|
1292
1292
|
...binChunk === void 0 ? {} : { binChunk }
|
|
1293
1293
|
});
|
|
1294
1294
|
}
|
|
1295
|
-
|
|
1296
|
-
// src/parse-skin.ts
|
|
1297
1295
|
var MAX_JOINTS = 256;
|
|
1298
1296
|
var SKIN_ACCESSOR_TYPES = ["MAT4"];
|
|
1299
1297
|
function identityMat4() {
|
|
@@ -1374,10 +1372,14 @@ function parseSkin(skinsJson, nodesJson, accessors, bufferViews, buffers) {
|
|
|
1374
1372
|
if (!pathResult.ok) return err(pathResult.error);
|
|
1375
1373
|
jointPaths.push(pathResult.value.join("/"));
|
|
1376
1374
|
}
|
|
1375
|
+
const bounds = parseConservativeAnimatedBounds(
|
|
1376
|
+
skin.extras?.forgeax?.conservativeAnimatedBounds
|
|
1377
|
+
);
|
|
1377
1378
|
records.push({
|
|
1378
1379
|
jointCount: joints.length,
|
|
1379
1380
|
inverseBindMatrices: ibm,
|
|
1380
|
-
jointPaths
|
|
1381
|
+
jointPaths,
|
|
1382
|
+
...bounds === void 0 ? {} : { bounds }
|
|
1381
1383
|
});
|
|
1382
1384
|
}
|
|
1383
1385
|
return ok(records);
|