@lovelace_lol/embody 0.0.1
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/LICENSE +21 -0
- package/README.md +2411 -0
- package/dist/authoring/boneAuthoring.d.ts +132 -0
- package/dist/camera/annotationCameraAngles.d.ts +28 -0
- package/dist/camera/cameraRelativeGaze.d.ts +15 -0
- package/dist/camera/rustAnnotationCameraCore.d.ts +136 -0
- package/dist/cljs.cjs +362 -0
- package/dist/cljs.cjs.map +1 -0
- package/dist/cljs.d.ts +5 -0
- package/dist/cljs.js +359 -0
- package/dist/cljs.js.map +1 -0
- package/dist/core/TsClipCompiler.d.ts +51 -0
- package/dist/core/TsRuntimeCore.d.ts +40 -0
- package/dist/core/WasmRuntimeCore.d.ts +55 -0
- package/dist/core/compositeAxis.d.ts +4 -0
- package/dist/core/contracts/abi.d.ts +70 -0
- package/dist/core/contracts/clip.d.ts +44 -0
- package/dist/core/contracts/frame.d.ts +27 -0
- package/dist/core/contracts/host.d.ts +28 -0
- package/dist/core/contracts/ids.d.ts +15 -0
- package/dist/core/contracts/index.d.ts +10 -0
- package/dist/core/contracts/model.d.ts +31 -0
- package/dist/core/contracts/primitives.d.ts +17 -0
- package/dist/core/contracts/skeletonFit.d.ts +41 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/types.d.ts +472 -0
- package/dist/core.cjs +1065 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.js +1040 -0
- package/dist/core.js.map +1 -0
- package/dist/engines/three/Embody.d.ts +373 -0
- package/dist/engines/three/ThreeAnimationRuntime.d.ts +203 -0
- package/dist/engines/three/ThreeClipAdapter.d.ts +24 -0
- package/dist/engines/three/ThreeFrameApplier.d.ts +68 -0
- package/dist/engines/three/ThreeModelInspector.d.ts +54 -0
- package/dist/engines/three/bakedClipPartitioning.d.ts +16 -0
- package/dist/engines/three/balanceUtils.d.ts +3 -0
- package/dist/engines/three/characterHost.d.ts +80 -0
- package/dist/engines/three/characterScene.d.ts +98 -0
- package/dist/engines/three/hair/HairPhysicsController.d.ts +124 -0
- package/dist/engines/three/index.d.ts +20 -0
- package/dist/engines/three/modelLoader.d.ts +61 -0
- package/dist/engines/three/profileTestScene.d.ts +52 -0
- package/dist/engines/three/types.d.ts +20 -0
- package/dist/hair/appearance.d.ts +29 -0
- package/dist/index.cjs +15431 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +15141 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/Animation.d.ts +315 -0
- package/dist/interfaces/EmbodyRuntime.d.ts +90 -0
- package/dist/interfaces/Hair.d.ts +181 -0
- package/dist/interfaces/HairPhysics.d.ts +90 -0
- package/dist/interfaces/index.d.ts +11 -0
- package/dist/mappings/extendPresetWithProfile.d.ts +17 -0
- package/dist/mappings/types.d.ts +309 -0
- package/dist/mappings/visemeSystem.d.ts +26 -0
- package/dist/physics/HairPhysics.d.ts +86 -0
- package/dist/physics/RustHairPhysics.d.ts +18 -0
- package/dist/physics/index.d.ts +6 -0
- package/dist/preset.cjs +2000 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.js +1997 -0
- package/dist/preset.js.map +1 -0
- package/dist/presets/bettaFish.d.ts +328 -0
- package/dist/presets/cc4.d.ts +145 -0
- package/dist/presets/index.d.ts +27 -0
- package/dist/profiles/resolveProfileConfig.d.ts +36 -0
- package/dist/profiles/types.d.ts +118 -0
- package/dist/regions/normalizeRegionTree.d.ts +6 -0
- package/dist/regions/regionMapping.d.ts +17 -0
- package/dist/regions/types.d.ts +122 -0
- package/dist/skeletonTemplates/humanoidSkeletonTemplates.d.ts +32 -0
- package/dist/test/setupWasm.d.ts +1 -0
- package/dist/three.cjs +10115 -0
- package/dist/three.cjs.map +1 -0
- package/dist/three.js +10086 -0
- package/dist/three.js.map +1 -0
- package/dist/validation/analyzeModel.d.ts +68 -0
- package/dist/validation/extractModelData.d.ts +90 -0
- package/dist/validation/generateMappingCorrections.d.ts +32 -0
- package/dist/validation/geometryHelpers.d.ts +66 -0
- package/dist/validation/types.d.ts +10 -0
- package/dist/validation/validateMappings.d.ts +77 -0
- package/dist/wasm/LICENSE +21 -0
- package/dist/wasm/README.md +72 -0
- package/dist/wasm/embody_wasm.d.ts +531 -0
- package/dist/wasm/embody_wasm.js +1635 -0
- package/dist/wasm/embody_wasm_bg.wasm +0 -0
- package/dist/wasm/embody_wasm_bg.wasm.d.ts +107 -0
- package/dist/wasm.cjs +302 -0
- package/dist/wasm.cjs.map +1 -0
- package/dist/wasm.d.ts +43 -0
- package/dist/wasm.js +268 -0
- package/dist/wasm.js.map +1 -0
- package/dist/wasmTypes.d.ts +121 -0
- package/package.json +99 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { BoneFrameDelta, FrameDelta, ModelDescriptor, MorphTargetFrameDelta } from './contracts';
|
|
2
|
+
import type { Profile } from '../mappings/types';
|
|
3
|
+
import type { EmbodyCoreWasmModule } from '../wasmTypes';
|
|
4
|
+
export declare const AU_MORPH_BINDING_STRIDE = 5;
|
|
5
|
+
export declare const VISEME_MORPH_BINDING_STRIDE = 4;
|
|
6
|
+
export type MorphBindingSide = 0 | 1 | 2;
|
|
7
|
+
export interface WasmRuntimeCoreOptions {
|
|
8
|
+
readonly profile: Profile;
|
|
9
|
+
readonly model: ModelDescriptor;
|
|
10
|
+
readonly wasm: EmbodyCoreWasmModule;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* TypeScript facade over the Rust Wasm RuntimeCore for live morph FrameDelta
|
|
14
|
+
* evaluation. Bones/composites remain on TsRuntimeCore until a later slice.
|
|
15
|
+
*/
|
|
16
|
+
export declare class WasmRuntimeCore {
|
|
17
|
+
private readonly wasm;
|
|
18
|
+
private readonly core;
|
|
19
|
+
private profile;
|
|
20
|
+
private model;
|
|
21
|
+
constructor(options: WasmRuntimeCoreOptions);
|
|
22
|
+
setProfile(profile: Profile): void;
|
|
23
|
+
setModelDescriptor(model: ModelDescriptor): void;
|
|
24
|
+
setAU(id: number, value: number, balance?: number): void;
|
|
25
|
+
getAU(id: number): number;
|
|
26
|
+
setAUMixWeight(id: number, weight: number): void;
|
|
27
|
+
setViseme(visemeIndex: number, value: number, jawScale?: number): void;
|
|
28
|
+
clear(): void;
|
|
29
|
+
evaluatePackedMorphFrameDelta(): Float32Array;
|
|
30
|
+
evaluatePackedBoneFrameDelta(): Float32Array;
|
|
31
|
+
evaluateMorphFrameDelta(deltaSeconds?: number): FrameDelta;
|
|
32
|
+
evaluateFrameDelta(deltaSeconds?: number): FrameDelta;
|
|
33
|
+
private reloadBindings;
|
|
34
|
+
}
|
|
35
|
+
export declare function compileMorphBindings(profile: Profile, model: ModelDescriptor): {
|
|
36
|
+
auBindings: Float32Array;
|
|
37
|
+
visemeBindings: Float32Array;
|
|
38
|
+
mixedAus: Uint32Array;
|
|
39
|
+
};
|
|
40
|
+
export interface CompiledBoneBindings {
|
|
41
|
+
restTransforms: Float32Array;
|
|
42
|
+
compositeAxes: Float32Array;
|
|
43
|
+
translations: Float32Array;
|
|
44
|
+
jawBinding: Float32Array;
|
|
45
|
+
visemeJawAmounts: Float32Array;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Compile profile bone mappings into the packed tables the Rust RuntimeCore
|
|
49
|
+
* consumes: rest transforms, composite rotation axes (in yaw/pitch/roll
|
|
50
|
+
* application order), AU translations, and the auto viseme jaw binding.
|
|
51
|
+
* Mirrors the mapping resolution in TsRuntimeCore.collectBoneWrites.
|
|
52
|
+
*/
|
|
53
|
+
export declare function compileBoneBindings(profile: Profile, model: ModelDescriptor): CompiledBoneBindings;
|
|
54
|
+
export declare function unpackBoneFrameDelta(values: ArrayLike<number>): BoneFrameDelta[];
|
|
55
|
+
export declare function unpackMorphFrameDelta(values: ArrayLike<number>): MorphTargetFrameDelta[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AUSelector, BoneBinding, RotationAxis } from './types';
|
|
2
|
+
export declare function toAUList(value?: AUSelector): number[];
|
|
3
|
+
export declare function getCompositeAxisValue(axisConfig: RotationAxis | null | undefined, getValue: (auId: number) => number): number;
|
|
4
|
+
export declare function getCompositeAxisBinding(nodeKey: string, axisConfig: RotationAxis | null | undefined, direction: number, getValue: (auId: number) => number, auToBones: Record<number, BoneBinding[]>): BoneBinding | null;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { NumericArray } from './primitives';
|
|
2
|
+
export declare const EMBODY_CORE_ABI_VERSION = 1;
|
|
3
|
+
export declare const PACKED_MORPH_FRAME_DELTA_STRIDE = 4;
|
|
4
|
+
export declare const PACKED_MORPH_FRAME_DELTA_FIELDS: readonly ["meshId", "morphTargetId", "value", "mode"];
|
|
5
|
+
export declare const PACKED_BONE_FRAME_DELTA_STRIDE = 9;
|
|
6
|
+
export declare const PACKED_BONE_FRAME_DELTA_FIELDS: readonly ["boneId", "positionX", "positionY", "positionZ", "rotationX", "rotationY", "rotationZ", "rotationW", "flags"];
|
|
7
|
+
/** Packed bone FrameDelta flags: bit 0 = has position, bit 1 = has rotation. */
|
|
8
|
+
export declare const PACKED_BONE_FLAG_HAS_POSITION = 1;
|
|
9
|
+
export declare const PACKED_BONE_FLAG_HAS_ROTATION = 2;
|
|
10
|
+
export declare const HAIR_CONFIG_STRIDE = 11;
|
|
11
|
+
export declare const HAIR_STATE_STRIDE = 4;
|
|
12
|
+
export declare const HAIR_HEAD_STATE_STRIDE = 5;
|
|
13
|
+
export declare const HAIR_MORPH_OUTPUT_STRIDE = 6;
|
|
14
|
+
export declare const TEMPLATE_SKELETON_FIT_TRANSFORM_STRIDE = 4;
|
|
15
|
+
export declare const MESH_PROPORTIONS_STRIDE = 16;
|
|
16
|
+
export declare const TEMPLATE_SKELETON_FIT_SOLUTION_STRIDE = 10;
|
|
17
|
+
export declare const ANNOTATION_CAMERA_FRAMING_STRIDE = 7;
|
|
18
|
+
export declare const CAMERA_FLIGHT_SAMPLE_STRIDE = 7;
|
|
19
|
+
export declare const MARKER_VISIBILITY_FACTORS_STRIDE = 3;
|
|
20
|
+
export declare const MARKER_ENDPOINT_STRIDE = 3;
|
|
21
|
+
export declare const HAIR_CONFIG_FIELDS: readonly ["mass", "stiffness", "damping", "gravity", "headInfluence", "windEnabled", "windStrength", "windDirectionX", "windDirectionZ", "windTurbulence", "windFrequency"];
|
|
22
|
+
export declare const HAIR_STATE_FIELDS: readonly ["x", "z", "vx", "vz"];
|
|
23
|
+
export declare const HAIR_HEAD_STATE_FIELDS: readonly ["yaw", "pitch", "roll", "yawVelocity", "pitchVelocity"];
|
|
24
|
+
export declare const HAIR_MORPH_OUTPUT_FIELDS: readonly ["L_Hair_Left", "L_Hair_Right", "L_Hair_Front", "R_Hair_Left", "R_Hair_Right", "R_Hair_Front"];
|
|
25
|
+
export declare const TEMPLATE_SKELETON_FIT_TRANSFORM_FIELDS: readonly ["scale", "translationX", "translationY", "translationZ"];
|
|
26
|
+
export declare const MESH_PROPORTIONS_FIELDS: readonly ["minX", "minY", "minZ", "maxX", "maxY", "maxZ", "centerX", "centerY", "centerZ", "spanX", "spanY", "spanZ", "verticalHeight", "crossAxisWideSpan", "crossAxisNarrowSpan", "humanoidLikelihood"];
|
|
27
|
+
export declare const TEMPLATE_SKELETON_FIT_SOLUTION_FIELDS: readonly ["scale", "translationX", "translationY", "translationZ", "confidence", "meshHeight", "templateHeight", "meshCrossAxisWideSpan", "templateCrossAxisWideSpan", "status"];
|
|
28
|
+
export declare const ANNOTATION_CAMERA_FRAMING_FIELDS: readonly ["positionX", "positionY", "positionZ", "targetX", "targetY", "targetZ", "distance"];
|
|
29
|
+
export declare const CAMERA_FLIGHT_SAMPLE_FIELDS: readonly ["positionX", "positionY", "positionZ", "targetX", "targetY", "targetZ", "done"];
|
|
30
|
+
export declare const MARKER_VISIBILITY_FACTORS_FIELDS: readonly ["itemOpacityFactor", "labelScaleFactor", "lineOpacityFactor"];
|
|
31
|
+
export declare const MARKER_ENDPOINT_FIELDS: readonly ["x", "y", "z"];
|
|
32
|
+
export type PackedMorphFrameDeltaField = (typeof PACKED_MORPH_FRAME_DELTA_FIELDS)[number];
|
|
33
|
+
export type HairConfigField = (typeof HAIR_CONFIG_FIELDS)[number];
|
|
34
|
+
export type HairStateField = (typeof HAIR_STATE_FIELDS)[number];
|
|
35
|
+
export type HairHeadStateField = (typeof HAIR_HEAD_STATE_FIELDS)[number];
|
|
36
|
+
export type HairMorphOutputField = (typeof HAIR_MORPH_OUTPUT_FIELDS)[number];
|
|
37
|
+
export type TemplateSkeletonFitTransformField = (typeof TEMPLATE_SKELETON_FIT_TRANSFORM_FIELDS)[number];
|
|
38
|
+
export type MeshProportionsField = (typeof MESH_PROPORTIONS_FIELDS)[number];
|
|
39
|
+
export type TemplateSkeletonFitSolutionField = (typeof TEMPLATE_SKELETON_FIT_SOLUTION_FIELDS)[number];
|
|
40
|
+
export interface PackedMorphFrameDelta {
|
|
41
|
+
readonly abiVersion: typeof EMBODY_CORE_ABI_VERSION;
|
|
42
|
+
readonly stride: typeof PACKED_MORPH_FRAME_DELTA_STRIDE;
|
|
43
|
+
readonly fields: typeof PACKED_MORPH_FRAME_DELTA_FIELDS;
|
|
44
|
+
readonly values: NumericArray;
|
|
45
|
+
}
|
|
46
|
+
export interface PackedHairPhysicsState {
|
|
47
|
+
readonly stride: typeof HAIR_STATE_STRIDE;
|
|
48
|
+
readonly fields: typeof HAIR_STATE_FIELDS;
|
|
49
|
+
readonly values: NumericArray;
|
|
50
|
+
}
|
|
51
|
+
export interface PackedHairMorphOutput {
|
|
52
|
+
readonly stride: typeof HAIR_MORPH_OUTPUT_STRIDE;
|
|
53
|
+
readonly fields: typeof HAIR_MORPH_OUTPUT_FIELDS;
|
|
54
|
+
readonly values: NumericArray;
|
|
55
|
+
}
|
|
56
|
+
export interface PackedTemplateSkeletonFitTransform {
|
|
57
|
+
readonly stride: typeof TEMPLATE_SKELETON_FIT_TRANSFORM_STRIDE;
|
|
58
|
+
readonly fields: typeof TEMPLATE_SKELETON_FIT_TRANSFORM_FIELDS;
|
|
59
|
+
readonly values: NumericArray;
|
|
60
|
+
}
|
|
61
|
+
export interface PackedMeshProportions {
|
|
62
|
+
readonly stride: typeof MESH_PROPORTIONS_STRIDE;
|
|
63
|
+
readonly fields: typeof MESH_PROPORTIONS_FIELDS;
|
|
64
|
+
readonly values: NumericArray;
|
|
65
|
+
}
|
|
66
|
+
export interface PackedTemplateSkeletonFitSolution {
|
|
67
|
+
readonly stride: typeof TEMPLATE_SKELETON_FIT_SOLUTION_STRIDE;
|
|
68
|
+
readonly fields: typeof TEMPLATE_SKELETON_FIT_SOLUTION_FIELDS;
|
|
69
|
+
readonly values: NumericArray;
|
|
70
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { BoneId, ChannelId, MeshId, MorphTargetId, TrackId } from './ids';
|
|
2
|
+
import type { NumericArray } from './primitives';
|
|
3
|
+
export type ClipChannelKind = 'face' | 'body' | 'scene' | 'custom';
|
|
4
|
+
export type ClipTrackValueType = 'scalar' | 'vec3' | 'quat';
|
|
5
|
+
export type ClipInterpolation = 'step' | 'linear' | 'cubic';
|
|
6
|
+
export type ClipTrackTargetKind = 'morphTarget' | 'boneTransform' | 'meshVisibility';
|
|
7
|
+
export type ClipTrackTransformProperty = 'position' | 'rotation' | 'scale';
|
|
8
|
+
export interface ClipChannelIR {
|
|
9
|
+
readonly id: ChannelId;
|
|
10
|
+
readonly kind: ClipChannelKind;
|
|
11
|
+
readonly name?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface MorphTargetTrackTarget {
|
|
14
|
+
readonly kind: 'morphTarget';
|
|
15
|
+
readonly meshId: MeshId;
|
|
16
|
+
readonly morphTargetId: MorphTargetId;
|
|
17
|
+
}
|
|
18
|
+
export interface BoneTransformTrackTarget {
|
|
19
|
+
readonly kind: 'boneTransform';
|
|
20
|
+
readonly boneId: BoneId;
|
|
21
|
+
readonly property: ClipTrackTransformProperty;
|
|
22
|
+
}
|
|
23
|
+
export interface MeshVisibilityTrackTarget {
|
|
24
|
+
readonly kind: 'meshVisibility';
|
|
25
|
+
readonly meshId: MeshId;
|
|
26
|
+
}
|
|
27
|
+
export type ClipTrackTarget = MorphTargetTrackTarget | BoneTransformTrackTarget | MeshVisibilityTrackTarget;
|
|
28
|
+
export interface ClipTrackIR {
|
|
29
|
+
readonly id: TrackId;
|
|
30
|
+
readonly channelId: ChannelId;
|
|
31
|
+
readonly target: ClipTrackTarget;
|
|
32
|
+
readonly valueType: ClipTrackValueType;
|
|
33
|
+
readonly times: NumericArray;
|
|
34
|
+
readonly values: NumericArray;
|
|
35
|
+
readonly interpolation?: ClipInterpolation;
|
|
36
|
+
}
|
|
37
|
+
export interface ClipIR {
|
|
38
|
+
readonly id?: string;
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly durationSeconds: number;
|
|
41
|
+
readonly channels: readonly ClipChannelIR[];
|
|
42
|
+
readonly tracks: readonly ClipTrackIR[];
|
|
43
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BoneId, MeshId, MorphTargetId } from './ids';
|
|
2
|
+
import type { Transform } from './primitives';
|
|
3
|
+
export type FrameValueMode = 'absolute' | 'additive';
|
|
4
|
+
export type TransformSpace = 'local' | 'model';
|
|
5
|
+
export interface MorphTargetFrameDelta {
|
|
6
|
+
readonly meshId: MeshId;
|
|
7
|
+
readonly morphTargetId: MorphTargetId;
|
|
8
|
+
readonly value: number;
|
|
9
|
+
readonly mode?: FrameValueMode;
|
|
10
|
+
}
|
|
11
|
+
export interface BoneFrameDelta {
|
|
12
|
+
readonly boneId: BoneId;
|
|
13
|
+
readonly transform: Transform;
|
|
14
|
+
readonly mode?: FrameValueMode;
|
|
15
|
+
readonly space?: TransformSpace;
|
|
16
|
+
}
|
|
17
|
+
export interface MeshFrameDelta {
|
|
18
|
+
readonly meshId: MeshId;
|
|
19
|
+
readonly visible?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface FrameDelta {
|
|
22
|
+
readonly timeSeconds?: number;
|
|
23
|
+
readonly deltaSeconds?: number;
|
|
24
|
+
readonly morphTargets?: readonly MorphTargetFrameDelta[];
|
|
25
|
+
readonly bones?: readonly BoneFrameDelta[];
|
|
26
|
+
readonly meshes?: readonly MeshFrameDelta[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ClipIR } from './clip';
|
|
2
|
+
import type { FrameDelta } from './frame';
|
|
3
|
+
import type { ModelDescriptor } from './model';
|
|
4
|
+
export interface HostModelInspector<HostModel = unknown> {
|
|
5
|
+
describeModel(model: HostModel): ModelDescriptor;
|
|
6
|
+
}
|
|
7
|
+
export interface HostFrameApplier<HostModel = unknown> {
|
|
8
|
+
applyFrameDelta(model: HostModel, frame: FrameDelta): void;
|
|
9
|
+
}
|
|
10
|
+
export interface HostAnimationHandle {
|
|
11
|
+
readonly id?: string;
|
|
12
|
+
stop(): void;
|
|
13
|
+
pause?(): void;
|
|
14
|
+
resume?(): void;
|
|
15
|
+
setWeight?(weight: number): void;
|
|
16
|
+
setPlaybackRate?(playbackRate: number): void;
|
|
17
|
+
}
|
|
18
|
+
export interface HostAnimationPlayOptions {
|
|
19
|
+
readonly weight?: number;
|
|
20
|
+
readonly playbackRate?: number;
|
|
21
|
+
readonly loop?: boolean;
|
|
22
|
+
readonly startTimeSeconds?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface HostAnimationSystem<HostModel = unknown, HostClip = unknown, AnimationHandle extends HostAnimationHandle = HostAnimationHandle> extends HostModelInspector<HostModel>, HostFrameApplier<HostModel> {
|
|
25
|
+
createClip(model: HostModel, clip: ClipIR): HostClip;
|
|
26
|
+
playClip(model: HostModel, clip: HostClip, options?: HostAnimationPlayOptions): AnimationHandle | null;
|
|
27
|
+
update?(model: HostModel, deltaSeconds: number): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable numeric identifiers used by host-neutral model, frame, and clip
|
|
3
|
+
* contracts. Adapters assign these ids while inspecting a host model and keep
|
|
4
|
+
* them stable for the lifetime of that descriptor.
|
|
5
|
+
*/
|
|
6
|
+
type StableNumericId<Tag extends string> = number & {
|
|
7
|
+
readonly __embodyStableId: Tag;
|
|
8
|
+
};
|
|
9
|
+
export type MeshId = StableNumericId<'mesh'>;
|
|
10
|
+
export type MorphTargetId = StableNumericId<'morphTarget'>;
|
|
11
|
+
export type BoneId = StableNumericId<'bone'>;
|
|
12
|
+
export type TrackId = StableNumericId<'track'>;
|
|
13
|
+
export type ChannelId = StableNumericId<'channel'>;
|
|
14
|
+
export type HostTargetId = MeshId | MorphTargetId | BoneId;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { HairConfigField, HairHeadStateField, HairMorphOutputField, HairStateField, PackedHairMorphOutput, PackedHairPhysicsState, PackedMeshProportions, PackedMorphFrameDelta, PackedMorphFrameDeltaField, PackedTemplateSkeletonFitSolution, PackedTemplateSkeletonFitTransform, TemplateSkeletonFitTransformField, MeshProportionsField, TemplateSkeletonFitSolutionField, } from './abi';
|
|
2
|
+
export { ANNOTATION_CAMERA_FRAMING_FIELDS, ANNOTATION_CAMERA_FRAMING_STRIDE, CAMERA_FLIGHT_SAMPLE_FIELDS, CAMERA_FLIGHT_SAMPLE_STRIDE, EMBODY_CORE_ABI_VERSION, HAIR_CONFIG_FIELDS, HAIR_CONFIG_STRIDE, HAIR_HEAD_STATE_FIELDS, HAIR_HEAD_STATE_STRIDE, HAIR_MORPH_OUTPUT_FIELDS, HAIR_MORPH_OUTPUT_STRIDE, HAIR_STATE_FIELDS, HAIR_STATE_STRIDE, MARKER_VISIBILITY_FACTORS_FIELDS, MARKER_VISIBILITY_FACTORS_STRIDE, MARKER_ENDPOINT_FIELDS, MARKER_ENDPOINT_STRIDE, MESH_PROPORTIONS_FIELDS, MESH_PROPORTIONS_STRIDE, PACKED_MORPH_FRAME_DELTA_FIELDS, PACKED_MORPH_FRAME_DELTA_STRIDE, PACKED_BONE_FRAME_DELTA_FIELDS, PACKED_BONE_FRAME_DELTA_STRIDE, PACKED_BONE_FLAG_HAS_POSITION, PACKED_BONE_FLAG_HAS_ROTATION, TEMPLATE_SKELETON_FIT_SOLUTION_FIELDS, TEMPLATE_SKELETON_FIT_SOLUTION_STRIDE, TEMPLATE_SKELETON_FIT_TRANSFORM_FIELDS, TEMPLATE_SKELETON_FIT_TRANSFORM_STRIDE, } from './abi';
|
|
3
|
+
export type { BoneId, ChannelId, HostTargetId, MeshId, MorphTargetId, TrackId, } from './ids';
|
|
4
|
+
export type { NumericArray, Quat, Transform, Vec3, } from './primitives';
|
|
5
|
+
export { TEMPLATE_SKELETON_FIT_METADATA_KIND, TEMPLATE_SKELETON_FIT_METADATA_VERSION, TEMPLATE_SKELETON_FIT_STATUSES, TEMPLATE_SKELETON_FIT_VERTICAL_ANCHORS, TEMPLATE_SKELETON_FIT_VERTICAL_AXES, composeTemplateSkeletonFitTransform, isTemplateSkeletonFitStatus, validateTemplateSkeletonFitMetadata, } from './skeletonFit';
|
|
6
|
+
export type { TemplateSkeletonFitManualAdjustment, TemplateSkeletonFitMetadata, TemplateSkeletonFitMetrics, TemplateSkeletonFitStatus, TemplateSkeletonFitTransform, TemplateSkeletonFitValidationResult, TemplateSkeletonFitVerticalAnchor, TemplateSkeletonFitVerticalAxis, } from './skeletonFit';
|
|
7
|
+
export type { BoneDescriptor, MeshDescriptor, ModelDescriptor, MorphTargetDescriptor, } from './model';
|
|
8
|
+
export type { BoneFrameDelta, FrameDelta, FrameValueMode, MeshFrameDelta, MorphTargetFrameDelta, TransformSpace, } from './frame';
|
|
9
|
+
export type { BoneTransformTrackTarget, ClipChannelIR, ClipChannelKind, ClipIR, ClipInterpolation, ClipTrackIR, ClipTrackTarget, ClipTrackTargetKind, ClipTrackTransformProperty, ClipTrackValueType, MeshVisibilityTrackTarget, MorphTargetTrackTarget, } from './clip';
|
|
10
|
+
export type { HostAnimationHandle, HostAnimationPlayOptions, HostAnimationSystem, HostFrameApplier, HostModelInspector, } from './host';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { BoneId, MeshId, MorphTargetId } from './ids';
|
|
2
|
+
import type { Transform } from './primitives';
|
|
3
|
+
export interface MorphTargetDescriptor {
|
|
4
|
+
readonly id: MorphTargetId;
|
|
5
|
+
readonly meshId: MeshId;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** Host-local morph slot/index, recorded as data and not used as identity. */
|
|
8
|
+
readonly hostIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MeshDescriptor {
|
|
11
|
+
readonly id: MeshId;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly parentBoneId?: BoneId;
|
|
14
|
+
readonly morphTargetIds: readonly MorphTargetId[];
|
|
15
|
+
readonly visible?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface BoneDescriptor {
|
|
18
|
+
readonly id: BoneId;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly parentId?: BoneId;
|
|
21
|
+
readonly childIds: readonly BoneId[];
|
|
22
|
+
readonly restTransform?: Transform;
|
|
23
|
+
}
|
|
24
|
+
export interface ModelDescriptor {
|
|
25
|
+
readonly id?: string;
|
|
26
|
+
readonly name?: string;
|
|
27
|
+
readonly meshes: readonly MeshDescriptor[];
|
|
28
|
+
readonly morphTargets: readonly MorphTargetDescriptor[];
|
|
29
|
+
readonly bones: readonly BoneDescriptor[];
|
|
30
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type NumericArray = readonly number[] | Float32Array;
|
|
2
|
+
export interface Vec3 {
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
readonly z: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Quat {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
readonly z: number;
|
|
11
|
+
readonly w: number;
|
|
12
|
+
}
|
|
13
|
+
export interface Transform {
|
|
14
|
+
readonly position?: Vec3;
|
|
15
|
+
readonly rotation?: Quat;
|
|
16
|
+
readonly scale?: Vec3;
|
|
17
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Vec3 } from './primitives';
|
|
2
|
+
export declare const TEMPLATE_SKELETON_FIT_METADATA_KIND = "template-skeleton-fit";
|
|
3
|
+
export declare const TEMPLATE_SKELETON_FIT_METADATA_VERSION = 1;
|
|
4
|
+
export declare const TEMPLATE_SKELETON_FIT_STATUSES: readonly ["unfitted", "estimated", "manual-adjusted", "invalid"];
|
|
5
|
+
export declare const TEMPLATE_SKELETON_FIT_VERTICAL_AXES: readonly ["x", "y", "z"];
|
|
6
|
+
export declare const TEMPLATE_SKELETON_FIT_VERTICAL_ANCHORS: readonly ["min", "center", "max"];
|
|
7
|
+
export type TemplateSkeletonFitStatus = (typeof TEMPLATE_SKELETON_FIT_STATUSES)[number];
|
|
8
|
+
export type TemplateSkeletonFitVerticalAxis = (typeof TEMPLATE_SKELETON_FIT_VERTICAL_AXES)[number];
|
|
9
|
+
export type TemplateSkeletonFitVerticalAnchor = (typeof TEMPLATE_SKELETON_FIT_VERTICAL_ANCHORS)[number];
|
|
10
|
+
export interface TemplateSkeletonFitTransform {
|
|
11
|
+
readonly scale: number;
|
|
12
|
+
readonly translation: Vec3;
|
|
13
|
+
}
|
|
14
|
+
export interface TemplateSkeletonFitMetrics extends TemplateSkeletonFitTransform {
|
|
15
|
+
readonly confidence: number;
|
|
16
|
+
readonly meshHeight: number;
|
|
17
|
+
readonly templateHeight: number;
|
|
18
|
+
readonly crossAxisSpans: Vec3;
|
|
19
|
+
readonly status: TemplateSkeletonFitStatus;
|
|
20
|
+
}
|
|
21
|
+
export interface TemplateSkeletonFitManualAdjustment {
|
|
22
|
+
readonly scale?: number;
|
|
23
|
+
readonly translation?: Vec3;
|
|
24
|
+
}
|
|
25
|
+
export interface TemplateSkeletonFitMetadata {
|
|
26
|
+
readonly kind: typeof TEMPLATE_SKELETON_FIT_METADATA_KIND;
|
|
27
|
+
readonly version: typeof TEMPLATE_SKELETON_FIT_METADATA_VERSION;
|
|
28
|
+
readonly templateId: string;
|
|
29
|
+
readonly sourceCharacterId: string;
|
|
30
|
+
readonly verticalAxis: TemplateSkeletonFitVerticalAxis;
|
|
31
|
+
readonly verticalAnchor: TemplateSkeletonFitVerticalAnchor;
|
|
32
|
+
readonly fit: TemplateSkeletonFitMetrics;
|
|
33
|
+
readonly manualAdjustment?: TemplateSkeletonFitManualAdjustment;
|
|
34
|
+
}
|
|
35
|
+
export interface TemplateSkeletonFitValidationResult {
|
|
36
|
+
readonly valid: boolean;
|
|
37
|
+
readonly errors: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
export declare function isTemplateSkeletonFitStatus(value: unknown): value is TemplateSkeletonFitStatus;
|
|
40
|
+
export declare function composeTemplateSkeletonFitTransform(fit: TemplateSkeletonFitTransform, manualAdjustment?: TemplateSkeletonFitManualAdjustment): TemplateSkeletonFitTransform;
|
|
41
|
+
export declare function validateTemplateSkeletonFitMetadata(metadata: unknown): TemplateSkeletonFitValidationResult;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { BoneDescriptor, BoneFrameDelta, BoneId, BoneTransformTrackTarget, ChannelId, ClipChannelIR, ClipChannelKind, ClipIR, ClipInterpolation, ClipTrackIR, ClipTrackTarget, ClipTrackTargetKind, ClipTrackTransformProperty, ClipTrackValueType, FrameDelta, FrameValueMode, HostAnimationHandle, HostAnimationPlayOptions, HostAnimationSystem, HostFrameApplier, HostModelInspector, HostTargetId, MeshDescriptor, MeshFrameDelta, MeshId, MeshVisibilityTrackTarget, ModelDescriptor, MorphTargetDescriptor, MorphTargetFrameDelta, MorphTargetId, MorphTargetTrackTarget, NumericArray, PackedMeshProportions, PackedTemplateSkeletonFitSolution, Quat, MeshProportionsField, TemplateSkeletonFitSolutionField, TemplateSkeletonFitManualAdjustment, TemplateSkeletonFitMetadata, TemplateSkeletonFitMetrics, TemplateSkeletonFitStatus, TemplateSkeletonFitTransform, TemplateSkeletonFitTransformField, TemplateSkeletonFitValidationResult, TemplateSkeletonFitVerticalAnchor, TemplateSkeletonFitVerticalAxis, TrackId, Transform, TransformSpace, Vec3, } from './contracts';
|
|
2
|
+
export { TEMPLATE_SKELETON_FIT_METADATA_KIND, TEMPLATE_SKELETON_FIT_METADATA_VERSION, MESH_PROPORTIONS_FIELDS, MESH_PROPORTIONS_STRIDE, TEMPLATE_SKELETON_FIT_STATUSES, TEMPLATE_SKELETON_FIT_SOLUTION_FIELDS, TEMPLATE_SKELETON_FIT_SOLUTION_STRIDE, TEMPLATE_SKELETON_FIT_TRANSFORM_FIELDS, TEMPLATE_SKELETON_FIT_TRANSFORM_STRIDE, TEMPLATE_SKELETON_FIT_VERTICAL_ANCHORS, TEMPLATE_SKELETON_FIT_VERTICAL_AXES, composeTemplateSkeletonFitTransform, isTemplateSkeletonFitStatus, validateTemplateSkeletonFitMetadata, } from './contracts';
|
|
3
|
+
export { TsClipCompiler, numericArrayToNumbers, } from './TsClipCompiler';
|
|
4
|
+
export { TsRuntimeCore } from './TsRuntimeCore';
|
|
5
|
+
export { AU_MORPH_BINDING_STRIDE, VISEME_MORPH_BINDING_STRIDE, WasmRuntimeCore, compileMorphBindings, compileBoneBindings, unpackMorphFrameDelta, unpackBoneFrameDelta, } from './WasmRuntimeCore';
|
|
6
|
+
export type { CompiledBoneBindings, MorphBindingSide, WasmRuntimeCoreOptions, } from './WasmRuntimeCore';
|
|
7
|
+
export type { TsClipCompilerInput, TsClipCompilerKeyframe, TsClipCompilerTrackInput, TsClipCurveTarget, TsClipCurvesInput, } from './TsClipCompiler';
|
|
8
|
+
export type { TsRuntimeCoreOptions } from './TsRuntimeCore';
|