@forgeax/engine-gltf 0.1.31 → 0.1.33
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/dist/gltf-importer.d.ts.map +1 -1
- package/dist/importer-entry.mjs +6 -2
- package/dist/importer-entry.mjs.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/gltf-importer.ts +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-importer.d.ts","sourceRoot":"","sources":["../src/gltf-importer.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EAMT,MAAM,uBAAuB,CAAC;AAoB/B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"gltf-importer.d.ts","sourceRoot":"","sources":["../src/gltf-importer.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EAMT,MAAM,uBAAuB,CAAC;AAoB/B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAC;AAgVlF,iFAAiF;AACjF,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,OAAO,EACZ,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/C,kBAAkB,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GAC1D,SAAS,QAAQ,EAAE,CA2CrB;AA6oBD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,8BAA8B,GAAG,QAAQ,CAMrF;AAED,8EAA8E;AAC9E,eAAO,MAAM,YAAY,EAAE,QAA+B,CAAC"}
|
package/dist/importer-entry.mjs
CHANGED
|
@@ -3316,6 +3316,10 @@ async function parseGlbForImporter(buffer, filePath, options = {}) {
|
|
|
3316
3316
|
function isGlbBytes(source) {
|
|
3317
3317
|
return source.toLowerCase().endsWith(".glb");
|
|
3318
3318
|
}
|
|
3319
|
+
function parseFailureMessage(prefix, error) {
|
|
3320
|
+
const detail = error.detail === void 0 ? "" : ` detail=${JSON.stringify(error.detail)}`;
|
|
3321
|
+
return `${prefix}: ${error.code} ${error.expected}${detail}`;
|
|
3322
|
+
}
|
|
3319
3323
|
function publishesCatalogProduct(input) {
|
|
3320
3324
|
return input.importSettings.geometry !== "procedural";
|
|
3321
3325
|
}
|
|
@@ -3451,7 +3455,7 @@ async function parseDoc(source, bytes, ctx, meshopt) {
|
|
|
3451
3455
|
const res2 = await parseGlbForImporter(ab, source, meshopt === void 0 ? {} : { meshopt });
|
|
3452
3456
|
if (!res2.ok) {
|
|
3453
3457
|
if (res2.error instanceof ImportError) return { ok: false, error: res2.error };
|
|
3454
|
-
throw new Error(
|
|
3458
|
+
throw new Error(parseFailureMessage("parseGlb failed", res2.error));
|
|
3455
3459
|
}
|
|
3456
3460
|
return { ok: true, value: res2.value };
|
|
3457
3461
|
}
|
|
@@ -3479,7 +3483,7 @@ async function parseDoc(source, bytes, ctx, meshopt) {
|
|
|
3479
3483
|
);
|
|
3480
3484
|
if (!res.ok) {
|
|
3481
3485
|
if (res.error instanceof ImportError) return { ok: false, error: res.error };
|
|
3482
|
-
throw new Error(
|
|
3486
|
+
throw new Error(parseFailureMessage("parseGltf failed", res.error));
|
|
3483
3487
|
}
|
|
3484
3488
|
return { ok: true, value: res.value };
|
|
3485
3489
|
}
|