@automovie/ingest 0.3.4 → 0.4.0
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 +9 -29
- package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.d.ts +4 -1
- package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js +4 -1
- package/lib/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.js.map +1 -1
- package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.d.ts +4 -1
- package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js +4 -1
- package/lib/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.js.map +1 -1
- package/lib/adoptAutoMovieExternalMotion.d.ts +21 -11
- package/lib/adoptAutoMovieExternalMotion.js +26 -12
- package/lib/adoptAutoMovieExternalMotion.js.map +1 -1
- package/lib/audio/admitProductionTtsReceipt.d.ts +25 -0
- package/lib/audio/admitProductionTtsReceipt.js +166 -0
- package/lib/audio/admitProductionTtsReceipt.js.map +1 -0
- package/lib/audio/decodeProductionAudioAsset.d.ts +42 -14
- package/lib/audio/decodeProductionAudioAsset.js +53 -30
- package/lib/audio/decodeProductionAudioAsset.js.map +1 -1
- package/lib/audio/index.d.ts +1 -0
- package/lib/audio/index.js +1 -0
- package/lib/audio/index.js.map +1 -1
- package/lib/audio/resampleProductionAudio.d.ts +22 -0
- package/lib/audio/resampleProductionAudio.js +103 -0
- package/lib/audio/resampleProductionAudio.js.map +1 -0
- package/lib/decodeAutoMoviePpmImage.d.ts +10 -18
- package/lib/decodeAutoMoviePpmImage.js +10 -18
- package/lib/decodeAutoMoviePpmImage.js.map +1 -1
- package/lib/font/TrueTypeByteReader.d.ts +34 -0
- package/lib/font/TrueTypeByteReader.js +67 -0
- package/lib/font/TrueTypeByteReader.js.map +1 -0
- package/lib/font/decodeAutoMovieTrueTypeFont.d.ts +31 -0
- package/lib/font/decodeAutoMovieTrueTypeFont.js +168 -0
- package/lib/font/decodeAutoMovieTrueTypeFont.js.map +1 -0
- package/lib/font/index.d.ts +1 -0
- package/lib/font/index.js +18 -0
- package/lib/font/index.js.map +1 -0
- package/lib/font/readTrueTypeCharacterMap.d.ts +23 -0
- package/lib/font/readTrueTypeCharacterMap.js +98 -0
- package/lib/font/readTrueTypeCharacterMap.js.map +1 -0
- package/lib/font/readTrueTypeGlyphOutline.d.ts +45 -0
- package/lib/font/readTrueTypeGlyphOutline.js +275 -0
- package/lib/font/readTrueTypeGlyphOutline.js.map +1 -0
- package/lib/font/readTrueTypeKerning.d.ts +19 -0
- package/lib/font/readTrueTypeKerning.js +63 -0
- package/lib/font/readTrueTypeKerning.js.map +1 -0
- package/lib/font/readTrueTypeNames.d.ts +20 -0
- package/lib/font/readTrueTypeNames.js +75 -0
- package/lib/font/readTrueTypeNames.js.map +1 -0
- package/lib/humanoidSkeleton.d.ts +28 -15
- package/lib/humanoidSkeleton.js +28 -15
- package/lib/humanoidSkeleton.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/ingestDocument.d.ts +25 -12
- package/lib/ingestDocument.js +25 -12
- package/lib/ingestDocument.js.map +1 -1
- package/lib/inspectAutoMovieExternalModelBytes.d.ts +24 -12
- package/lib/inspectAutoMovieExternalModelBytes.js +24 -12
- package/lib/inspectAutoMovieExternalModelBytes.js.map +1 -1
- package/lib/internal/IAccessorSource.d.ts +11 -8
- package/lib/internal/IExternalModelAccessorReader.d.ts +1 -8
- package/lib/internal/IHumanoidSlot.d.ts +9 -10
- package/lib/internal/IParsedContainer.d.ts +10 -8
- package/lib/internal/SHAPE_COMPONENTS.d.ts +4 -1
- package/lib/internal/SHAPE_COMPONENTS.js +4 -1
- package/lib/internal/SHAPE_COMPONENTS.js.map +1 -1
- package/lib/internal/accessorElementByteLength.d.ts +1 -11
- package/lib/internal/accessorElementByteLength.js +1 -11
- package/lib/internal/accessorElementByteLength.js.map +1 -1
- package/lib/internal/accessorReader.d.ts +5 -9
- package/lib/internal/accessorReader.js +5 -9
- package/lib/internal/accessorReader.js.map +1 -1
- package/lib/internal/accessorValues.d.ts +10 -10
- package/lib/internal/accessorValues.js +10 -10
- package/lib/internal/collectExternalResources.d.ts +1 -11
- package/lib/internal/collectExternalResources.js +1 -11
- package/lib/internal/collectExternalResources.js.map +1 -1
- package/lib/internal/compareCodeUnits.d.ts +1 -11
- package/lib/internal/compareCodeUnits.js +1 -11
- package/lib/internal/compareCodeUnits.js.map +1 -1
- package/lib/internal/composeLocalTransform.d.ts +13 -10
- package/lib/internal/composeLocalTransform.js +13 -10
- package/lib/internal/composeLocalTransform.js.map +1 -1
- package/lib/internal/decodeDataUri.d.ts +4 -9
- package/lib/internal/decodeDataUri.js +4 -9
- package/lib/internal/decodeDataUri.js.map +1 -1
- package/lib/internal/decodeGlb.d.ts +1 -11
- package/lib/internal/decodeGlb.js +1 -11
- package/lib/internal/decodeGlb.js.map +1 -1
- package/lib/internal/decodeJson.d.ts +1 -11
- package/lib/internal/decodeJson.js +10 -12
- package/lib/internal/decodeJson.js.map +1 -1
- package/lib/internal/fileExtension.d.ts +2 -9
- package/lib/internal/fileExtension.js +2 -9
- package/lib/internal/fileExtension.js.map +1 -1
- package/lib/internal/finiteTuple.d.ts +4 -9
- package/lib/internal/finiteTuple.js +4 -9
- package/lib/internal/finiteTuple.js.map +1 -1
- package/lib/internal/gltfHumanoidBones.d.ts +5 -9
- package/lib/internal/gltfHumanoidBones.js +5 -9
- package/lib/internal/gltfHumanoidBones.js.map +1 -1
- package/lib/internal/humanoidBoneOfName.d.ts +7 -9
- package/lib/internal/humanoidBoneOfName.js +7 -9
- package/lib/internal/humanoidBoneOfName.js.map +1 -1
- package/lib/internal/inspectExternalModelHierarchy.d.ts +1 -11
- package/lib/internal/inspectExternalModelHierarchy.js +1 -11
- package/lib/internal/inspectExternalModelHierarchy.js.map +1 -1
- package/lib/internal/inspectExternalMotion.d.ts +8 -9
- package/lib/internal/inspectExternalMotion.js +8 -9
- package/lib/internal/inspectExternalMotion.js.map +1 -1
- package/lib/internal/inspectExternalMotionNodes.d.ts +6 -9
- package/lib/internal/inspectExternalMotionNodes.js +6 -9
- package/lib/internal/inspectExternalMotionNodes.js.map +1 -1
- package/lib/internal/integerIndex.d.ts +1 -11
- package/lib/internal/integerIndex.js +1 -11
- package/lib/internal/integerIndex.js.map +1 -1
- package/lib/internal/integerIndices.d.ts +1 -11
- package/lib/internal/integerIndices.js +1 -11
- package/lib/internal/integerIndices.js.map +1 -1
- package/lib/internal/nonNegativeInteger.d.ts +1 -11
- package/lib/internal/nonNegativeInteger.js +1 -11
- package/lib/internal/nonNegativeInteger.js.map +1 -1
- package/lib/internal/object.d.ts +1 -11
- package/lib/internal/object.js +1 -11
- package/lib/internal/object.js.map +1 -1
- package/lib/internal/optionalArray.d.ts +1 -11
- package/lib/internal/optionalArray.js +1 -11
- package/lib/internal/optionalArray.js.map +1 -1
- package/lib/internal/optionalObject.d.ts +1 -11
- package/lib/internal/optionalObject.js +1 -11
- package/lib/internal/optionalObject.js.map +1 -1
- package/lib/internal/optionalStringArray.d.ts +1 -11
- package/lib/internal/optionalStringArray.js +1 -11
- package/lib/internal/optionalStringArray.js.map +1 -1
- package/lib/internal/positiveInteger.d.ts +1 -11
- package/lib/internal/positiveInteger.js +1 -11
- package/lib/internal/positiveInteger.js.map +1 -1
- package/lib/internal/readMotionAccessor.d.ts +5 -9
- package/lib/internal/readMotionAccessor.js +5 -9
- package/lib/internal/readMotionAccessor.js.map +1 -1
- package/lib/internal/requiredArray.d.ts +1 -11
- package/lib/internal/requiredArray.js +1 -11
- package/lib/internal/requiredArray.js.map +1 -1
- package/lib/internal/uniqueStrings.d.ts +1 -11
- package/lib/internal/uniqueStrings.js +1 -11
- package/lib/internal/uniqueStrings.js.map +1 -1
- package/lib/internal/validNodeIndex.d.ts +1 -11
- package/lib/internal/validNodeIndex.js +1 -11
- package/lib/internal/validNodeIndex.js.map +1 -1
- package/lib/internal/validateAccessorRange.d.ts +6 -9
- package/lib/internal/validateAccessorRange.js +6 -9
- package/lib/internal/validateAccessorRange.js.map +1 -1
- package/lib/internal/validateHumanoidSkinning.d.ts +8 -10
- package/lib/internal/validateHumanoidSkinning.js +8 -10
- package/lib/internal/validateHumanoidSkinning.js.map +1 -1
- package/lib/internal/validatePayloadClosure.d.ts +8 -9
- package/lib/internal/validatePayloadClosure.js +8 -9
- package/lib/internal/validatePayloadClosure.js.map +1 -1
- package/lib/internal/validateSparseAccessor.d.ts +6 -9
- package/lib/internal/validateSparseAccessor.js +6 -9
- package/lib/internal/validateSparseAccessor.js.map +1 -1
- package/lib/internal/vrmHumanoidBones.d.ts +7 -9
- package/lib/internal/vrmHumanoidBones.js +12 -10
- package/lib/internal/vrmHumanoidBones.js.map +1 -1
- package/lib/isAutoMovieExternalModelIngestProfile.d.ts +4 -10
- package/lib/isAutoMovieExternalModelIngestProfile.js +4 -10
- package/lib/isAutoMovieExternalModelIngestProfile.js.map +1 -1
- package/package.json +7 -7
- package/src/AUTOMOVIE_GLTF_MOTION_INTERPRETATION_PROFILE.ts +4 -1
- package/src/AUTO_MOVIE_EXTERNAL_MODEL_INGEST_PROFILES.ts +4 -1
- package/src/adoptAutoMovieExternalMotion.ts +26 -12
- package/src/audio/admitProductionTtsReceipt.ts +262 -0
- package/src/audio/decodeProductionAudioAsset.ts +54 -39
- package/src/audio/index.ts +1 -0
- package/src/audio/resampleProductionAudio.ts +114 -0
- package/src/decodeAutoMoviePpmImage.ts +10 -18
- package/src/font/TrueTypeByteReader.ts +80 -0
- package/src/font/decodeAutoMovieTrueTypeFont.ts +217 -0
- package/src/font/index.ts +1 -0
- package/src/font/readTrueTypeCharacterMap.ts +115 -0
- package/src/font/readTrueTypeGlyphOutline.ts +375 -0
- package/src/font/readTrueTypeKerning.ts +73 -0
- package/src/font/readTrueTypeNames.ts +74 -0
- package/src/humanoidSkeleton.ts +28 -15
- package/src/index.ts +1 -0
- package/src/ingestDocument.ts +25 -12
- package/src/inspectAutoMovieExternalModelBytes.ts +24 -12
- package/src/internal/IAccessorSource.ts +11 -8
- package/src/internal/IExternalModelAccessorReader.ts +1 -8
- package/src/internal/IHumanoidSlot.ts +9 -10
- package/src/internal/IParsedContainer.ts +10 -8
- package/src/internal/SHAPE_COMPONENTS.ts +4 -1
- package/src/internal/accessorElementByteLength.ts +1 -11
- package/src/internal/accessorReader.ts +5 -9
- package/src/internal/accessorValues.ts +10 -10
- package/src/internal/collectExternalResources.ts +1 -11
- package/src/internal/compareCodeUnits.ts +1 -11
- package/src/internal/composeLocalTransform.ts +13 -10
- package/src/internal/decodeDataUri.ts +4 -9
- package/src/internal/decodeGlb.ts +1 -11
- package/src/internal/decodeJson.ts +10 -12
- package/src/internal/fileExtension.ts +2 -9
- package/src/internal/finiteTuple.ts +4 -9
- package/src/internal/gltfHumanoidBones.ts +5 -9
- package/src/internal/humanoidBoneOfName.ts +7 -9
- package/src/internal/inspectExternalModelHierarchy.ts +1 -11
- package/src/internal/inspectExternalMotion.ts +8 -9
- package/src/internal/inspectExternalMotionNodes.ts +6 -9
- package/src/internal/integerIndex.ts +1 -11
- package/src/internal/integerIndices.ts +1 -11
- package/src/internal/nonNegativeInteger.ts +1 -11
- package/src/internal/object.ts +1 -11
- package/src/internal/optionalArray.ts +1 -11
- package/src/internal/optionalObject.ts +1 -11
- package/src/internal/optionalStringArray.ts +1 -11
- package/src/internal/positiveInteger.ts +1 -11
- package/src/internal/readMotionAccessor.ts +5 -9
- package/src/internal/requiredArray.ts +1 -11
- package/src/internal/uniqueStrings.ts +1 -11
- package/src/internal/validNodeIndex.ts +1 -11
- package/src/internal/validateAccessorRange.ts +6 -9
- package/src/internal/validateHumanoidSkinning.ts +8 -10
- package/src/internal/validatePayloadClosure.ts +8 -9
- package/src/internal/validateSparseAccessor.ts +6 -9
- package/src/internal/vrmHumanoidBones.ts +12 -10
- package/src/isAutoMovieExternalMod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,GAAG,EAAE;YAChC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE;SACjC,CAAC;QACF,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC;YACjD,QAAQ,CAAC,IAAI,CACX,OAAO,CAAC,GAAG,CACT,CAAC,OAA8B,EAAyB,EAAE,CAAC,CAAC;gBAC1D,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;gBACzB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC7B,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;aACtB,CAAC,CACH,CACF,CAAC;IACN,CAAC,QAAQ,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE;IAC1C,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TrueTypeByteReader } from "./TrueTypeByteReader";
|
|
2
|
+
/**
|
|
3
|
+
* Read the horizontal kerning pairs of a `kern` table's format 0 subtables, by
|
|
4
|
+
* glyph index (ISO/IEC 14496-22, section 5.7.4).
|
|
5
|
+
*
|
|
6
|
+
* Only subtables that kern horizontally and hold kerning values, not minimum
|
|
7
|
+
* values or cross-stream adjustments, contribute, since those are what advance
|
|
8
|
+
* glyphs along a line. Their values add across subtables, as the format
|
|
9
|
+
* specifies, unless a subtable's override bit replaces the accumulated value.
|
|
10
|
+
* Subtables of other formats are skipped by their declared length.
|
|
11
|
+
*
|
|
12
|
+
* @param reader Bounds-checked reader over the font bytes.
|
|
13
|
+
* @param offset Byte offset of the `kern` table.
|
|
14
|
+
* @returns Adjustment in font units keyed by `left * 65536 + right` glyph
|
|
15
|
+
* indices. An Apple-format table, whose 32-bit version is 1.0, contributes no
|
|
16
|
+
* pairs.
|
|
17
|
+
* @throws {Error} A field lies outside the bytes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readTrueTypeKerning(reader: TrueTypeByteReader, offset: number): Map<number, number>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readTrueTypeKerning = readTrueTypeKerning;
|
|
4
|
+
/**
|
|
5
|
+
* `kern` subtable coverage bit 0 (ISO/IEC 14496-22, section 5.7.4): set when
|
|
6
|
+
* the subtable holds horizontal data, clear for vertical.
|
|
7
|
+
*/
|
|
8
|
+
const HORIZONTAL = 0x01;
|
|
9
|
+
/** Coverage bit 1: set when the subtable holds minimum values, not kerning. */
|
|
10
|
+
const MINIMUM = 0x02;
|
|
11
|
+
/** Coverage bit 2: set when the kerning is perpendicular to the text flow. */
|
|
12
|
+
const CROSS_STREAM = 0x04;
|
|
13
|
+
/**
|
|
14
|
+
* Coverage bit 3: set when the subtable's value replaces the value accumulated
|
|
15
|
+
* so far rather than adding to it.
|
|
16
|
+
*/
|
|
17
|
+
const OVERRIDE = 0x08;
|
|
18
|
+
/**
|
|
19
|
+
* Read the horizontal kerning pairs of a `kern` table's format 0 subtables, by
|
|
20
|
+
* glyph index (ISO/IEC 14496-22, section 5.7.4).
|
|
21
|
+
*
|
|
22
|
+
* Only subtables that kern horizontally and hold kerning values, not minimum
|
|
23
|
+
* values or cross-stream adjustments, contribute, since those are what advance
|
|
24
|
+
* glyphs along a line. Their values add across subtables, as the format
|
|
25
|
+
* specifies, unless a subtable's override bit replaces the accumulated value.
|
|
26
|
+
* Subtables of other formats are skipped by their declared length.
|
|
27
|
+
*
|
|
28
|
+
* @param reader Bounds-checked reader over the font bytes.
|
|
29
|
+
* @param offset Byte offset of the `kern` table.
|
|
30
|
+
* @returns Adjustment in font units keyed by `left * 65536 + right` glyph
|
|
31
|
+
* indices. An Apple-format table, whose 32-bit version is 1.0, contributes no
|
|
32
|
+
* pairs.
|
|
33
|
+
* @throws {Error} A field lies outside the bytes.
|
|
34
|
+
*/
|
|
35
|
+
function readTrueTypeKerning(reader, offset) {
|
|
36
|
+
// The Apple-format table (a 32-bit version 1.0) is not the OpenType one and
|
|
37
|
+
// contributes no pairs, like a font without kerning.
|
|
38
|
+
if (reader.u16(offset, "kern header") !== 0)
|
|
39
|
+
return new Map();
|
|
40
|
+
const tables = reader.u16(offset + 2, "kern header");
|
|
41
|
+
const pairs = new Map();
|
|
42
|
+
let cursor = offset + 4;
|
|
43
|
+
for (let table = 0; table < tables; ++table) {
|
|
44
|
+
const length = reader.u16(cursor + 2, "kern subtable header");
|
|
45
|
+
const coverage = reader.u16(cursor + 4, "kern subtable header");
|
|
46
|
+
reader.require(cursor, length, "kern subtable");
|
|
47
|
+
if (coverage >> 8 === 0 &&
|
|
48
|
+
(coverage & HORIZONTAL) !== 0 &&
|
|
49
|
+
(coverage & (MINIMUM | CROSS_STREAM)) === 0) {
|
|
50
|
+
const count = reader.u16(cursor + 6, "kern format 0 header");
|
|
51
|
+
reader.require(cursor + 14, count * 6, "kern format 0 pairs");
|
|
52
|
+
for (let pair = 0; pair < count; ++pair) {
|
|
53
|
+
const at = cursor + 14 + pair * 6;
|
|
54
|
+
const key = reader.u16(at, "kern pair") * 65536 + reader.u16(at + 2, "kern pair");
|
|
55
|
+
const value = reader.i16(at + 4, "kern pair");
|
|
56
|
+
pairs.set(key, (coverage & OVERRIDE) !== 0 ? value : (pairs.get(key) ?? 0) + value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
cursor += length;
|
|
60
|
+
}
|
|
61
|
+
return pairs;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=readTrueTypeKerning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readTrueTypeKerning.js","sourceRoot":"","sources":["../../src/font/readTrueTypeKerning.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAM,UAAU,GAAW,IAAI,CAAC;AAEhC,+EAA+E;AAC/E,MAAM,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,CAAC;YAC9D,KAAK,IAAI,IAAI,GAAW,CAAC,EAAE,IAAI,GAAG,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC;gBAChD,MAAM,EAAE,GAAW,MAAM,GAAG,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC;gBAC1C,MAAM,GAAG,GACP,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,WAAW,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;gBACxE,MAAM,KAAK,GAAW,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;gBACtD,KAAK,CAAC,GAAG,CACP,GAAG,EACH,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;QACD,MAAM,IAAI,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IAutoMovieFont } from "@automovie/interface";
|
|
2
|
+
import type { TrueTypeByteReader } from "./TrueTypeByteReader";
|
|
3
|
+
/**
|
|
4
|
+
* Read name IDs 1 (family), 13 (licence description) and 14 (licence URL) from
|
|
5
|
+
* a `name` table (ISO/IEC 14496-22, section 5.2.6).
|
|
6
|
+
*
|
|
7
|
+
* For each ID the Windows Unicode record in US English (platform 3, encoding 1
|
|
8
|
+
* or 10, language 0x0409) is preferred, then any Windows Unicode record, then a
|
|
9
|
+
* Unicode-platform record (platform 0); all three are UTF-16BE. A Macintosh
|
|
10
|
+
* Roman record (platform 1, encoding 0) is used last, and only when every byte
|
|
11
|
+
* is ASCII, because Mac Roman differs from Latin-1 above 0x7F and a guessed
|
|
12
|
+
* decoding would misstate a licence. Records are only described here; no rights
|
|
13
|
+
* are judged.
|
|
14
|
+
*
|
|
15
|
+
* @param reader Bounds-checked reader over the font bytes.
|
|
16
|
+
* @param offset Byte offset of the `name` table.
|
|
17
|
+
* @returns The three names, each `null` when no usable record carries it.
|
|
18
|
+
* @throws {Error} A record or its string lies outside the bytes.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readTrueTypeNames(reader: TrueTypeByteReader, offset: number): IAutoMovieFont["names"];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readTrueTypeNames = readTrueTypeNames;
|
|
4
|
+
/**
|
|
5
|
+
* Read name IDs 1 (family), 13 (licence description) and 14 (licence URL) from
|
|
6
|
+
* a `name` table (ISO/IEC 14496-22, section 5.2.6).
|
|
7
|
+
*
|
|
8
|
+
* For each ID the Windows Unicode record in US English (platform 3, encoding 1
|
|
9
|
+
* or 10, language 0x0409) is preferred, then any Windows Unicode record, then a
|
|
10
|
+
* Unicode-platform record (platform 0); all three are UTF-16BE. A Macintosh
|
|
11
|
+
* Roman record (platform 1, encoding 0) is used last, and only when every byte
|
|
12
|
+
* is ASCII, because Mac Roman differs from Latin-1 above 0x7F and a guessed
|
|
13
|
+
* decoding would misstate a licence. Records are only described here; no rights
|
|
14
|
+
* are judged.
|
|
15
|
+
*
|
|
16
|
+
* @param reader Bounds-checked reader over the font bytes.
|
|
17
|
+
* @param offset Byte offset of the `name` table.
|
|
18
|
+
* @returns The three names, each `null` when no usable record carries it.
|
|
19
|
+
* @throws {Error} A record or its string lies outside the bytes.
|
|
20
|
+
*/
|
|
21
|
+
function readTrueTypeNames(reader, offset) {
|
|
22
|
+
const count = reader.u16(offset + 2, "name header");
|
|
23
|
+
const strings = offset + reader.u16(offset + 4, "name header");
|
|
24
|
+
const best = new Map();
|
|
25
|
+
for (let index = 0; index < count; ++index) {
|
|
26
|
+
const record = offset + 6 + index * 12;
|
|
27
|
+
const platform = reader.u16(record, "name record");
|
|
28
|
+
const encoding = reader.u16(record + 2, "name record");
|
|
29
|
+
const language = reader.u16(record + 4, "name record");
|
|
30
|
+
const id = reader.u16(record + 6, "name record");
|
|
31
|
+
if (id !== 1 && id !== 13 && id !== 14)
|
|
32
|
+
continue;
|
|
33
|
+
const length = reader.u16(record + 8, "name record");
|
|
34
|
+
const at = strings + reader.u16(record + 10, "name record");
|
|
35
|
+
reader.require(at, length, "name string");
|
|
36
|
+
let rank;
|
|
37
|
+
let text = null;
|
|
38
|
+
if (platform === 3 && (encoding === 1 || encoding === 10)) {
|
|
39
|
+
rank = language === 0x0409 ? 0 : 1;
|
|
40
|
+
text = utf16(reader, at, length);
|
|
41
|
+
}
|
|
42
|
+
else if (platform === 0) {
|
|
43
|
+
rank = 2;
|
|
44
|
+
text = utf16(reader, at, length);
|
|
45
|
+
}
|
|
46
|
+
else if (platform === 1 && encoding === 0) {
|
|
47
|
+
rank = 3;
|
|
48
|
+
const codes = [];
|
|
49
|
+
for (let byte = 0; byte < length; ++byte)
|
|
50
|
+
codes.push(reader.u8(at + byte, "name string"));
|
|
51
|
+
if (codes.every((code) => code < 0x80))
|
|
52
|
+
text = String.fromCharCode(...codes);
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
continue;
|
|
56
|
+
if (text === null)
|
|
57
|
+
continue;
|
|
58
|
+
const previous = best.get(id);
|
|
59
|
+
if (previous === undefined || rank < previous.rank)
|
|
60
|
+
best.set(id, { rank, text });
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
family: best.get(1)?.text ?? null,
|
|
64
|
+
licenseDescription: best.get(13)?.text ?? null,
|
|
65
|
+
licenseUrl: best.get(14)?.text ?? null,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** Decode UTF-16BE code units, surrogate pairs included. */
|
|
69
|
+
function utf16(reader, at, length) {
|
|
70
|
+
const units = [];
|
|
71
|
+
for (let unit = 0; unit + 1 < length; unit += 2)
|
|
72
|
+
units.push(reader.u16(at + unit, "name string"));
|
|
73
|
+
return String.fromCharCode(...units);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=readTrueTypeNames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readTrueTypeNames.js","sourceRoot":"","sources":["../../src/font/readTrueTypeNames.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,2BACE,MAA0B,EAC1B,MAAc;IAEd,MAAM,KAAK,GAAW,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAW,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;IACvE,MAAM,IAAI,GAAgD,IAAI,GAAG,EAAE,CAAC;IACpE,KAAK,IAAI,KAAK,GAAW,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC;QACnD,MAAM,MAAM,GAAW,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAW,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC3D,MAAM,QAAQ,GAAW,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;QAC/D,MAAM,QAAQ,GAAW,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;QAC/D,MAAM,EAAE,GAAW,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;QACzD,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;YAAE,SAAS;QACjD,MAAM,MAAM,GAAW,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG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AAK,IAAI;YAAE,SAAS;QAC5B,MAAM,QAAQ,GAA+C,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC1E,IAAI,QAAQ,KAAK,SAAS,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI;YAChD,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI;QACjC,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI,IAAI;QAC9C,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI,IAAI;KACvC,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC5D,SAAS,KAAK,CAAC,MAA0B,EAAE,EAAU,EAAE,MAAc;IACnE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,IAAI,GAAW,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,IAAI,CAAC;QACrD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
import { IAutoMovieSkeleton } from "@automovie/interface";
|
|
2
2
|
import type { Document } from "@gltf-transform/core";
|
|
3
3
|
/**
|
|
4
|
-
* Retarget a parsed glTF's skins onto a normalized humanoid
|
|
4
|
+
* Retarget a parsed glTF's skins onto a normalized humanoid
|
|
5
|
+
* {@link IAutoMovieSkeleton} by matching joint names to
|
|
6
|
+
* {@link AutoMovieHumanoidBone} slots.
|
|
5
7
|
*
|
|
6
|
-
* This naming-based mapper currently has test callers in this repository.
|
|
8
|
+
* This naming-based mapper currently has test callers in this repository.
|
|
9
|
+
* Production motion adoption uses an explicit mapping against inspected nodes,
|
|
10
|
+
* so this export does not establish a production rig-inference flow.
|
|
7
11
|
*
|
|
8
|
-
* Every skin is read in document order and the first joint to claim a slot
|
|
12
|
+
* Every skin is read in document order and the first joint to claim a slot
|
|
13
|
+
* keeps it, because exporters bind clothes, hair and accessories as separate
|
|
14
|
+
* skins in no guaranteed order and the body rig must be found wherever it sits.
|
|
15
|
+
* A joint name maps through the supported Blender-style, Mixamo, VRM-style and
|
|
16
|
+
* Unreal mannequin aliases; fingers, eyes and jaw are not mapped.
|
|
9
17
|
*
|
|
10
|
-
* The hierarchy is rebuilt over mapped joints only: a bone's parent is its
|
|
18
|
+
* The hierarchy is rebuilt over mapped joints only: a bone's parent is its
|
|
19
|
+
* nearest mapped ancestor in the node tree, and the local TRS of every skipped
|
|
20
|
+
* helper node between them composes into the bone's rest, because
|
|
21
|
+
* {@link IAutoMovieBone.rest} is relative to `parent` and a dropped helper
|
|
22
|
+
* offset or roll would misplace every bone beneath it. With finite
|
|
23
|
+
* unit-quaternion TRS inputs, composition represents the affine product up to
|
|
24
|
+
* floating-point rounding when each helper scale commutes with its child
|
|
25
|
+
* rotation; otherwise it drops shear. This mapper does not admit or normalize
|
|
26
|
+
* raw node TRS. A root bone keeps its own local TRS, since armature and scene
|
|
27
|
+
* transforms belong to the imported object rather than the skeleton. Bones
|
|
28
|
+
* carry no constraint.
|
|
11
29
|
*
|
|
12
30
|
* @param doc Parsed document; it is only read.
|
|
13
|
-
* @param skeletonId Id copied verbatim to the returned skeleton; defaults to
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
*
|
|
19
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The alias table is this importer's declared naming vocabulary, not proof of bone anatomy; the table is a `Map`, so a joint named after an `Object.prototype` member such as `constructor` maps to nothing instead of an inherited function, and first-claim order is the documented rule for duplicate slots.
|
|
20
|
-
* @evidence contracts/development/common.md#meaningful-documentation The documentation states the every-skin first-claim rule and its reason, the covered naming conventions and unmapped fingers, eyes and jaw, the helper composition and its exactness, the root-bone exception, the null cases, the refused ancestor cycle, and that constraints are left empty.
|
|
21
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Work follows skins and joints, joint-name text normalization, nodes and child links, and each mapped bone's walk to the nearest mapped ancestor; hash lookups have expected constant cost, while each helper walk may revisit ancestors another bone's walk read, and reads each node at most once itself.
|
|
22
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Slot and parent maps are call-local; repeated ancestor walks remain bounded by mapped slots and document depth, while mutable Document contents and the requested skeleton id preclude a retained identity-only cache.
|
|
23
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The slot and parent maps, the helper arrays and each walk's visited set are local and released on return or throw; the returned skeleton holds new transform objects proportional to the mapped bones, at most the humanoid slot count, owned by the caller.
|
|
31
|
+
* @param skeletonId Id copied verbatim to the returned skeleton; defaults to
|
|
32
|
+
* "skeleton" and is not validated here.
|
|
33
|
+
* @returns The skeleton with bones in first-claim order, or `null` when no skin
|
|
34
|
+
* joint maps to the required `hips` slot.
|
|
35
|
+
* @throws {Error} When a mapped joint's ancestors loop, which no glTF node
|
|
36
|
+
* hierarchy may.
|
|
24
37
|
*/
|
|
25
38
|
export declare const humanoidSkeleton: (doc: Document, skeletonId?: string) => IAutoMovieSkeleton | null;
|
package/lib/humanoidSkeleton.js
CHANGED
|
@@ -4,26 +4,39 @@ exports.humanoidSkeleton = void 0;
|
|
|
4
4
|
const composeLocalTransform_1 = require("./internal/composeLocalTransform");
|
|
5
5
|
const humanoidBoneOfName_1 = require("./internal/humanoidBoneOfName");
|
|
6
6
|
/**
|
|
7
|
-
* Retarget a parsed glTF's skins onto a normalized humanoid
|
|
7
|
+
* Retarget a parsed glTF's skins onto a normalized humanoid
|
|
8
|
+
* {@link IAutoMovieSkeleton} by matching joint names to
|
|
9
|
+
* {@link AutoMovieHumanoidBone} slots.
|
|
8
10
|
*
|
|
9
|
-
* This naming-based mapper currently has test callers in this repository.
|
|
11
|
+
* This naming-based mapper currently has test callers in this repository.
|
|
12
|
+
* Production motion adoption uses an explicit mapping against inspected nodes,
|
|
13
|
+
* so this export does not establish a production rig-inference flow.
|
|
10
14
|
*
|
|
11
|
-
* Every skin is read in document order and the first joint to claim a slot
|
|
15
|
+
* Every skin is read in document order and the first joint to claim a slot
|
|
16
|
+
* keeps it, because exporters bind clothes, hair and accessories as separate
|
|
17
|
+
* skins in no guaranteed order and the body rig must be found wherever it sits.
|
|
18
|
+
* A joint name maps through the supported Blender-style, Mixamo, VRM-style and
|
|
19
|
+
* Unreal mannequin aliases; fingers, eyes and jaw are not mapped.
|
|
12
20
|
*
|
|
13
|
-
* The hierarchy is rebuilt over mapped joints only: a bone's parent is its
|
|
21
|
+
* The hierarchy is rebuilt over mapped joints only: a bone's parent is its
|
|
22
|
+
* nearest mapped ancestor in the node tree, and the local TRS of every skipped
|
|
23
|
+
* helper node between them composes into the bone's rest, because
|
|
24
|
+
* {@link IAutoMovieBone.rest} is relative to `parent` and a dropped helper
|
|
25
|
+
* offset or roll would misplace every bone beneath it. With finite
|
|
26
|
+
* unit-quaternion TRS inputs, composition represents the affine product up to
|
|
27
|
+
* floating-point rounding when each helper scale commutes with its child
|
|
28
|
+
* rotation; otherwise it drops shear. This mapper does not admit or normalize
|
|
29
|
+
* raw node TRS. A root bone keeps its own local TRS, since armature and scene
|
|
30
|
+
* transforms belong to the imported object rather than the skeleton. Bones
|
|
31
|
+
* carry no constraint.
|
|
14
32
|
*
|
|
15
33
|
* @param doc Parsed document; it is only read.
|
|
16
|
-
* @param skeletonId Id copied verbatim to the returned skeleton; defaults to
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
21
|
-
*
|
|
22
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The alias table is this importer's declared naming vocabulary, not proof of bone anatomy; the table is a `Map`, so a joint named after an `Object.prototype` member such as `constructor` maps to nothing instead of an inherited function, and first-claim order is the documented rule for duplicate slots.
|
|
23
|
-
* @evidence contracts/development/common.md#meaningful-documentation The documentation states the every-skin first-claim rule and its reason, the covered naming conventions and unmapped fingers, eyes and jaw, the helper composition and its exactness, the root-bone exception, the null cases, the refused ancestor cycle, and that constraints are left empty.
|
|
24
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Work follows skins and joints, joint-name text normalization, nodes and child links, and each mapped bone's walk to the nearest mapped ancestor; hash lookups have expected constant cost, while each helper walk may revisit ancestors another bone's walk read, and reads each node at most once itself.
|
|
25
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Slot and parent maps are call-local; repeated ancestor walks remain bounded by mapped slots and document depth, while mutable Document contents and the requested skeleton id preclude a retained identity-only cache.
|
|
26
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The slot and parent maps, the helper arrays and each walk's visited set are local and released on return or throw; the returned skeleton holds new transform objects proportional to the mapped bones, at most the humanoid slot count, owned by the caller.
|
|
34
|
+
* @param skeletonId Id copied verbatim to the returned skeleton; defaults to
|
|
35
|
+
* "skeleton" and is not validated here.
|
|
36
|
+
* @returns The skeleton with bones in first-claim order, or `null` when no skin
|
|
37
|
+
* joint maps to the required `hips` slot.
|
|
38
|
+
* @throws {Error} When a mapped joint's ancestors loop, which no glTF node
|
|
39
|
+
* hierarchy may.
|
|
27
40
|
*/
|
|
28
41
|
const humanoidSkeleton = (doc, skeletonId = "skeleton") => {
|
|
29
42
|
const skins = doc.getRoot().listSkins();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanoidSkeleton.js","sourceRoot":"","sources":["../src/humanoidSkeleton.ts"],"names":[],"mappings":";;;AAcA,4EAAyE;AACzE,sEAAmE;AAEnE
|
|
1
|
+
{"version":3,"file":"humanoidSkeleton.js","sourceRoot":"","sources":["../src/humanoidS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AE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC,CAAC;AAjEW,QAAA,gBAAgB,GAAhB,gBAAgB,CAiE3B;AAEF,MAAM,cAAc,GAA4C,CAC9D,IAAc,EACO,EAAE;IACvB,MAAM,CAAC,GAAS,IAAI,CAAC,cAAc,EAAE,CAAC;IACtC,MAAM,CAAC,GAAS,IAAI,CAAC,WAAW,EAAE,CAAC;IACnC,MAAM,CAAC,GAAS,IAAI,CAAC,QAAQ,EAAE,CAAC;IAChC,OAAO;QACL,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QAC1C,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QAChD,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;KACrC,CAAC;AACJ,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -23,4 +23,5 @@ __exportStar(require("./isAutoMovieExternalModelIngestProfile"), exports);
|
|
|
23
23
|
__exportStar(require("./inspectAutoMovieExternalModelBytes"), exports);
|
|
24
24
|
__exportStar(require("./adoptAutoMovieExternalMotion"), exports);
|
|
25
25
|
__exportStar(require("./decodeAutoMoviePpmImage"), exports);
|
|
26
|
+
__exportStar(require("./font"), exports);
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mDAAiC;AACjC,qDAAmC;AACnC,iFAA+D;AAC/D,8EAA4D;AAC5D,0EAAwD;AACxD,uEAAqD;AACrD,iEAA+C;AAC/C,4DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,mDAAiC;AACjC,qDAAmC;AACnC,iFAA+D;AAC/D,8EAA4D;AAC5D,0EAAwD;AACxD,uEAAqD;AACrD,iEAA+C;AAC/C,4DAA0C;AAC1C,yCAAuB"}
|
package/lib/ingestDocument.d.ts
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
import type { IAutoMovieIngestResult } from "@automovie/interface";
|
|
2
2
|
import type { Document } from "@gltf-transform/core";
|
|
3
3
|
/**
|
|
4
|
-
* Map a parsed glTF/GLB {@link Document} onto automovie's core node graph and
|
|
4
|
+
* Map a parsed glTF/GLB {@link Document} onto automovie's core node graph and
|
|
5
|
+
* animation clips, with no three.js and no humanoid assumptions.
|
|
5
6
|
*
|
|
6
|
-
* Current repository callers exercise this parsed-document mapper through
|
|
7
|
+
* Current repository callers exercise this parsed-document mapper through
|
|
8
|
+
* tests. The production asset inventory uses the separate byte inspector and
|
|
9
|
+
* host loaders; this export does not establish a wired parsed-document runtime
|
|
10
|
+
* import flow.
|
|
7
11
|
*
|
|
8
|
-
* `@gltf-transform/core` parses the bytes headlessly, and this mapper rewrites
|
|
12
|
+
* `@gltf-transform/core` parses the bytes headlessly, and this mapper rewrites
|
|
13
|
+
* its structures structurally so props, cameras and characters import the same
|
|
14
|
+
* way. Every node keeps its local TRS, its parent, and the mesh, camera and
|
|
15
|
+
* skin it carries; a skin joint is a `bone` even when it also carries a mesh,
|
|
16
|
+
* then a mesh node is `mesh`, a camera node `camera`, and anything else
|
|
17
|
+
* `group`. Lights are not read. Every animation channel becomes a node track
|
|
18
|
+
* with the glTF sampler's keyframes, its interpolation mapped LINEAR, STEP and
|
|
19
|
+
* CUBICSPLINE to `linear`, `step` and `cubicspline` with an absent one read as
|
|
20
|
+
* LINEAR as glTF specifies, and its values decoded from normalized integers
|
|
21
|
+
* where the accessor declares them. Naming-based humanoid skeleton mapping is
|
|
22
|
+
* the separate {@link humanoidSkeleton} stage.
|
|
9
23
|
*
|
|
10
|
-
* Channel checks refuse no target node, no or unknown target path, no sampler,
|
|
24
|
+
* Channel checks refuse no target node, no or unknown target path, no sampler,
|
|
25
|
+
* no input or output data, an unknown interpolation, keyframe times that are
|
|
26
|
+
* not finite, non-negative and strictly increasing, non-finite output values,
|
|
27
|
+
* or an output length that disagrees with the keyframe count, the path's
|
|
28
|
+
* component count and the cubic-spline tangent triple. This is not complete
|
|
29
|
+
* model admission: node TRS, graph/resource membership, duplicate target
|
|
30
|
+
* channels, rotation magnitude and weights against the target morph count are
|
|
31
|
+
* caller premises rather than checks performed here.
|
|
11
32
|
*
|
|
12
33
|
* @param doc Parsed document; it is only read.
|
|
13
34
|
* @returns New arrays the caller owns, sharing no storage with the document.
|
|
14
|
-
*
|
|
15
|
-
* @evidence contracts/development/implementation.md#principled-implementation Node and clip structure is mapped one to one with index ids, kinds follow a fixed precedence of joint, mesh, camera, then group, and each channel is checked against glTF's own sampler rules: an allowed path and interpolation, strictly increasing times, finite values, and output arity of keyframes times components times three for cubic splines; normalized accessors decode through `accessorValues`.
|
|
16
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure The function builds the id, parent, joint and resource-index maps once and maps nodes and animations; `toTrack` owns all channel validation, and the path and interpolation tables enumerate supported sampler vocabulary.
|
|
17
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An unknown interpolation or target path throws rather than receiving a fallback interpretation, and no fixture-specific node, path or value is special-cased; lights are documented as not read.
|
|
18
|
-
* @evidence contracts/development/common.md#meaningful-documentation The documentation states what each node keeps, the kind precedence, the interpolation mapping, normalized decoding, every refusal, and that the returned arrays share no storage with the document.
|
|
19
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Work follows nodes and child links, meshes, cameras, skins and joints, animations and channels, and all per-track copied keyframe components; resource-index maps are built once and lookups use expected constant-time hash operations.
|
|
20
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Maps are reused within one call over a mutable Document; a sampler shared by channels is copied per track so each track owns its arrays, and no cache coordinates separate calls.
|
|
21
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The lookup maps are local and released on return or throw; the result retains new node records and per-track copies of keyframe data proportional to the document's animation size, owned by the caller, and no handle or task.
|
|
22
35
|
*/
|
|
23
36
|
export declare const ingestDocument: (doc: Document) => IAutoMovieIngestResult;
|
package/lib/ingestDocument.js
CHANGED
|
@@ -3,24 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ingestDocument = void 0;
|
|
4
4
|
const accessorValues_1 = require("./internal/accessorValues");
|
|
5
5
|
/**
|
|
6
|
-
* Map a parsed glTF/GLB {@link Document} onto automovie's core node graph and
|
|
6
|
+
* Map a parsed glTF/GLB {@link Document} onto automovie's core node graph and
|
|
7
|
+
* animation clips, with no three.js and no humanoid assumptions.
|
|
7
8
|
*
|
|
8
|
-
* Current repository callers exercise this parsed-document mapper through
|
|
9
|
+
* Current repository callers exercise this parsed-document mapper through
|
|
10
|
+
* tests. The production asset inventory uses the separate byte inspector and
|
|
11
|
+
* host loaders; this export does not establish a wired parsed-document runtime
|
|
12
|
+
* import flow.
|
|
9
13
|
*
|
|
10
|
-
* `@gltf-transform/core` parses the bytes headlessly, and this mapper rewrites
|
|
14
|
+
* `@gltf-transform/core` parses the bytes headlessly, and this mapper rewrites
|
|
15
|
+
* its structures structurally so props, cameras and characters import the same
|
|
16
|
+
* way. Every node keeps its local TRS, its parent, and the mesh, camera and
|
|
17
|
+
* skin it carries; a skin joint is a `bone` even when it also carries a mesh,
|
|
18
|
+
* then a mesh node is `mesh`, a camera node `camera`, and anything else
|
|
19
|
+
* `group`. Lights are not read. Every animation channel becomes a node track
|
|
20
|
+
* with the glTF sampler's keyframes, its interpolation mapped LINEAR, STEP and
|
|
21
|
+
* CUBICSPLINE to `linear`, `step` and `cubicspline` with an absent one read as
|
|
22
|
+
* LINEAR as glTF specifies, and its values decoded from normalized integers
|
|
23
|
+
* where the accessor declares them. Naming-based humanoid skeleton mapping is
|
|
24
|
+
* the separate {@link humanoidSkeleton} stage.
|
|
11
25
|
*
|
|
12
|
-
* Channel checks refuse no target node, no or unknown target path, no sampler,
|
|
26
|
+
* Channel checks refuse no target node, no or unknown target path, no sampler,
|
|
27
|
+
* no input or output data, an unknown interpolation, keyframe times that are
|
|
28
|
+
* not finite, non-negative and strictly increasing, non-finite output values,
|
|
29
|
+
* or an output length that disagrees with the keyframe count, the path's
|
|
30
|
+
* component count and the cubic-spline tangent triple. This is not complete
|
|
31
|
+
* model admission: node TRS, graph/resource membership, duplicate target
|
|
32
|
+
* channels, rotation magnitude and weights against the target morph count are
|
|
33
|
+
* caller premises rather than checks performed here.
|
|
13
34
|
*
|
|
14
35
|
* @param doc Parsed document; it is only read.
|
|
15
36
|
* @returns New arrays the caller owns, sharing no storage with the document.
|
|
16
|
-
*
|
|
17
|
-
* @evidence contracts/development/implementation.md#principled-implementation Node and clip structure is mapped one to one with index ids, kinds follow a fixed precedence of joint, mesh, camera, then group, and each channel is checked against glTF's own sampler rules: an allowed path and interpolation, strictly increasing times, finite values, and output arity of keyframes times components times three for cubic splines; normalized accessors decode through `accessorValues`.
|
|
18
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure The function builds the id, parent, joint and resource-index maps once and maps nodes and animations; `toTrack` owns all channel validation, and the path and interpolation tables enumerate supported sampler vocabulary.
|
|
19
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An unknown interpolation or target path throws rather than receiving a fallback interpretation, and no fixture-specific node, path or value is special-cased; lights are documented as not read.
|
|
20
|
-
* @evidence contracts/development/common.md#meaningful-documentation The documentation states what each node keeps, the kind precedence, the interpolation mapping, normalized decoding, every refusal, and that the returned arrays share no storage with the document.
|
|
21
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Work follows nodes and child links, meshes, cameras, skins and joints, animations and channels, and all per-track copied keyframe components; resource-index maps are built once and lookups use expected constant-time hash operations.
|
|
22
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Maps are reused within one call over a mutable Document; a sampler shared by channels is copied per track so each track owns its arrays, and no cache coordinates separate calls.
|
|
23
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The lookup maps are local and released on return or throw; the result retains new node records and per-track copies of keyframe data proportional to the document's animation size, owned by the caller, and no handle or task.
|
|
24
37
|
*/
|
|
25
38
|
const ingestDocument = (doc) => {
|
|
26
39
|
const root = doc.getRoot();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestDocument.js","sourceRoot":"","sources":["../src/ingestDocument.ts"],"names":[],"mappings":";;;AAuBA,8DAA2D;AAE3D
|
|
1
|
+
{"version":3,"file":"ingestDocument.js","sourceRoot":"","sources":["../src/ingestDocument.ts"],"names":[],"mappings":";;;AAuBA,8DAA2D;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACI,MAAM,cAAc,GAA8C,CACvE,GAAa,EACW,EAAE;IAC1B,MAAM,IAAI,GAAS,GAAG,CAAC,OAAO,EAAE,CAAC;IACjC,MAAM,SAAS,GAAe,IAAI,CAAC,SAAS,EAAE,CAAC;IAE/C,MAAM,QAAQ,GAA0B,IAAI,GAAG,EAAoB,CAAC;IACpE,SAAS,CAAC,OAAO,CAAC,CAAC,IAAc,EAAE,CAAS,EAAQ,EAAE;QACpD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAA4B,IAAI,GA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,CAAE,GAAG,CAAC;YACb,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAE,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC;YAErC,OAAO,IAAI,CACT,6EAA6E,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAChG,CAAC;IACN,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,KAAK;QACzC,OAAO,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAE9C,MAAM,gBAAgB,GACpB,KAAK,CAAC,MAAM,GAAG,CAAC,aAAa,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAkB,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,QAAQ,GAAW,gBAAgB,GAAG,KAAK,CAAC;QAClD,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ;YAC5B,OAAO,IAAI,CACT,GAAG,IAAI,iCAAiC,QAAQ,aAAa,MAAM,CAAC,MAAM,EAAE,CAC7E,CAAC;IACN,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,GAAG,gBAAgB,KAAK,CAAC;QAC/C,OAAO,IAAI,CACT,sDAAsD,gBAAgB,aAAa,MAAM,CAAC,MAAM,EAAE,CACnG,CAAC;IAEJ,OAAO;QACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,KAAK;QACL,MAAM;QACN,aAAa;KACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -2,22 +2,34 @@ import type { IAutoMovieExternalModelInspection } from "@automovie/interface";
|
|
|
2
2
|
/**
|
|
3
3
|
* Parse and validate exact external model bytes before compilation.
|
|
4
4
|
*
|
|
5
|
-
* The container is chosen by the path suffix: `.gltf` is UTF-8 JSON, `.glb` and
|
|
5
|
+
* The container is chosen by the path suffix: `.gltf` is UTF-8 JSON, `.glb` and
|
|
6
|
+
* `.vrm` are GLB 2.0 with one JSON chunk and at most one BIN chunk. JSON that
|
|
7
|
+
* is not strict UTF-8, does not parse, or repeats a member name after escape
|
|
8
|
+
* decoding is refused, because a last-wins duplicate could hide the value
|
|
9
|
+
* another loader reads. The document must declare asset version 2.0 and a
|
|
10
|
+
* forest of nodes; node mesh/skin/child links, scene roots, skin joints,
|
|
11
|
+
* primitive POSITION/indices and buffer/accessor references read here must
|
|
12
|
+
* resolve; buffers, buffer views, accessors, sparse ranges and images must fit
|
|
13
|
+
* their declared and resident bytes; and every non-data buffer sidecar must
|
|
14
|
+
* come back from `resolveResource` with the declared length, while URI images
|
|
15
|
+
* require nonempty bytes. The selected profile then adds its own requirements,
|
|
16
|
+
* as {@link AutoMovieExternalModelIngestProfile} lists. This is a fixed-profile
|
|
17
|
+
* admission gate, not a complete glTF validator: material/texture links and
|
|
18
|
+
* unconsumed attributes are left to host loaders, sparse payload contents and
|
|
19
|
+
* image media formats are not decoded here, and the skin/motion owners state
|
|
20
|
+
* their additional restrictions. The inspector never guesses a profile or
|
|
21
|
+
* repairs input: the first violation throws with the JSON path it concerns.
|
|
6
22
|
*
|
|
7
|
-
* Under `vrm-humanoid-v1`, `VRMC_vrm` is read with VRM 1.0 bone names, so a
|
|
23
|
+
* Under `vrm-humanoid-v1`, `VRMC_vrm` is read with VRM 1.0 bone names, so a
|
|
24
|
+
* 1.0-beta file that still writes thumbs the VRM 0.x way is read as 1.0.
|
|
8
25
|
*
|
|
9
|
-
* @param props.path Project-relative source path; its suffix selects the
|
|
26
|
+
* @param props.path Project-relative source path; its suffix selects the
|
|
27
|
+
* container.
|
|
10
28
|
* @param props.bytes Resident container bytes; they are only read.
|
|
11
29
|
* @param props.profile Caller-selected profile, refused unless supported.
|
|
12
|
-
* @param props.resolveResource Returns a sidecar's bytes for a URI, or `null`
|
|
30
|
+
* @param props.resolveResource Returns a sidecar's bytes for a URI, or `null`
|
|
31
|
+
* when unavailable; it is called once per external buffer and image URI
|
|
32
|
+
* entry, with caller-owned cost and effects.
|
|
13
33
|
* @returns New facts that hold no reference to the input bytes.
|
|
14
|
-
*
|
|
15
|
-
* @evidence contracts/development/implementation.md#principled-implementation The inspector follows the glTF 2.0 and GLB container rules: strict UTF-8 JSON with duplicate members refused by an iterative scan, index validation for the structural and profile fields it reads, forest and cycle checks by iterative parent walks, accessor and sparse ranges from component sizes with matrix column padding, payload lengths against declared buffers, and VRM 0.x thumbs migrated to VRM 1.0 slots by the published rename; the selected profile does not prove complete glTF validity, normalized complete skinning or anatomical correctness, and `VRMC_vrm` 1.0-beta thumb names are read as 1.0.
|
|
16
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure The exported orchestrator sequences structural, payload and profile owners; source-preserving internal splits keep each concern within the file/export limits, while public result types have independent file-named owners.
|
|
17
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Profiles and container suffixes are contract constants, no model or path is special-cased, the alias table is a `Map` so inherited names never resolve, and every refusal is the first violation found rather than a repaired value.
|
|
18
|
-
* @evidence contracts/development/common.md#meaningful-documentation The documentation states how the container is chosen, every structural requirement, the duplicate-member reason, the no-guess no-repair rule, the VRM 1.0-beta limitation, each parameter's role and call frequency, and that the result holds no byte reference.
|
|
19
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Work follows container bytes for UTF-8/JSON and duplicate scanning, declared entries and name text, skinned components, motion values and encoded data URIs, plus full caller resolver work per external URI entry; resource/extension sorting uses O(U log U) and O(X log X) prefix-scanning comparisons. Per-accessor readers resolve views/strides once, and the BIN slice borrows container storage.
|
|
20
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Within one inspection, a motion accessor is decoded once per accessor and type and shared by every channel that cites it, each track receiving its own copy, and a mesh and skin pair bound on several nodes is weight-checked once; the key is the accessor index or pair, which is valid because the document is immutable during the synchronous call.
|
|
21
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The decoded JSON, payload list, readers and caches live only for the call and are released on return or throw; the result retains copies proportional to resources, slots and motion data, and keeps neither the container nor sidecar bytes.
|
|
22
34
|
*/
|
|
23
35
|
export declare const inspectAutoMovieExternalModelBytes: (props: IAutoMovieExternalModelInspection.IProps) => IAutoMovieExternalModelInspection;
|