@lovelace_lol/embody 0.0.6 → 0.0.8

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.
Files changed (127) hide show
  1. package/README.md +541 -2394
  2. package/dist/index.d.ts +2 -100
  3. package/dist/index.js +7714 -12951
  4. package/dist/index.js.map +1 -1
  5. package/dist/three/annotations/DOMControls.d.ts +73 -0
  6. package/dist/three/annotations/DPthree.d.ts +113 -0
  7. package/dist/three/annotations/DPthree3DMarkers.d.ts +319 -0
  8. package/dist/three/annotations/DPthreeCameraController.d.ts +414 -0
  9. package/dist/three/annotations/DPthreeHTMLMarkers.d.ts +131 -0
  10. package/dist/three/annotations/DPthreeMarkers.d.ts +52 -0
  11. package/dist/three/annotations/adapter.d.ts +157 -0
  12. package/dist/three/annotations/animationFrameTaskScheduler.d.ts +18 -0
  13. package/dist/three/annotations/annotationAnchorModel.d.ts +16 -0
  14. package/dist/three/annotations/annotationCameraCore.d.ts +5 -0
  15. package/dist/three/annotations/boneResolutionProfile.d.ts +7 -0
  16. package/dist/three/annotations/index.d.ts +20 -0
  17. package/dist/three/annotations/loadFrame.d.ts +2 -0
  18. package/dist/three/annotations/markerSurfaceRaycast.d.ts +11 -0
  19. package/dist/three/annotations/markerVisibilityLifecycle.d.ts +21 -0
  20. package/dist/three/annotations/modelRenderPreparation.d.ts +6 -0
  21. package/dist/three/annotations/runtimeAnnotationPreview.d.ts +15 -0
  22. package/dist/three/annotations/runtimeAnnotationPreviewSide.d.ts +10 -0
  23. package/dist/three/annotations/runtimeAnnotationSidePreview.d.ts +5 -0
  24. package/dist/three/annotations/types.d.ts +262 -0
  25. package/dist/three/gaze.d.ts +122 -0
  26. package/dist/three/index.d.ts +147 -0
  27. package/dist/three/model.d.ts +31 -0
  28. package/dist/three/modelSkinning.d.ts +3 -0
  29. package/dist/three/reference-pose.d.ts +73 -0
  30. package/dist/three/scene.d.ts +253 -0
  31. package/dist/three/sceneRenderingBinding.d.ts +22 -0
  32. package/dist/three.js +7696 -8936
  33. package/dist/three.js.map +1 -1
  34. package/dist/wasm/README.md +551 -62
  35. package/dist/wasm/auto.d.ts +1 -0
  36. package/dist/wasm/embody_wasm.d.ts +388 -52
  37. package/dist/wasm/embody_wasm.js +1514 -119
  38. package/dist/wasm/embody_wasm_bg.wasm +0 -0
  39. package/dist/wasm/embody_wasm_bg.wasm.d.ts +115 -40
  40. package/dist/wasm/index.d.ts +126 -0
  41. package/dist/wasm.d.ts +1 -43
  42. package/dist/wasm.js +1043 -239
  43. package/dist/wasm.js.map +1 -1
  44. package/package.json +34 -39
  45. package/service-worker/character-asset-service-worker.js +295 -0
  46. package/dist/authoring/boneAuthoring.d.ts +0 -132
  47. package/dist/camera/annotationCameraAngles.d.ts +0 -28
  48. package/dist/camera/cameraRelativeGaze.d.ts +0 -15
  49. package/dist/camera/rustAnnotationCameraCore.d.ts +0 -136
  50. package/dist/cljs.cjs +0 -362
  51. package/dist/cljs.cjs.map +0 -1
  52. package/dist/cljs.d.ts +0 -5
  53. package/dist/cljs.js +0 -359
  54. package/dist/cljs.js.map +0 -1
  55. package/dist/core/TsClipCompiler.d.ts +0 -51
  56. package/dist/core/WasmRuntimeCore.d.ts +0 -41
  57. package/dist/core/compositeAxis.d.ts +0 -4
  58. package/dist/core/contracts/abi.d.ts +0 -70
  59. package/dist/core/contracts/clip.d.ts +0 -44
  60. package/dist/core/contracts/frame.d.ts +0 -27
  61. package/dist/core/contracts/host.d.ts +0 -28
  62. package/dist/core/contracts/ids.d.ts +0 -15
  63. package/dist/core/contracts/index.d.ts +0 -10
  64. package/dist/core/contracts/model.d.ts +0 -31
  65. package/dist/core/contracts/primitives.d.ts +0 -17
  66. package/dist/core/contracts/skeletonFit.d.ts +0 -41
  67. package/dist/core/index.d.ts +0 -6
  68. package/dist/core/types.d.ts +0 -472
  69. package/dist/core.cjs +0 -343
  70. package/dist/core.cjs.map +0 -1
  71. package/dist/core.js +0 -323
  72. package/dist/core.js.map +0 -1
  73. package/dist/engines/three/Embody.d.ts +0 -372
  74. package/dist/engines/three/ThreeAnimationRuntime.d.ts +0 -203
  75. package/dist/engines/three/ThreeClipAdapter.d.ts +0 -24
  76. package/dist/engines/three/ThreeFrameApplier.d.ts +0 -68
  77. package/dist/engines/three/ThreeModelInspector.d.ts +0 -54
  78. package/dist/engines/three/bakedClipPartitioning.d.ts +0 -16
  79. package/dist/engines/three/balanceUtils.d.ts +0 -3
  80. package/dist/engines/three/characterHost.d.ts +0 -80
  81. package/dist/engines/three/characterScene.d.ts +0 -98
  82. package/dist/engines/three/hair/HairPhysicsController.d.ts +0 -124
  83. package/dist/engines/three/index.d.ts +0 -20
  84. package/dist/engines/three/modelLoader.d.ts +0 -61
  85. package/dist/engines/three/profileTestScene.d.ts +0 -52
  86. package/dist/engines/three/types.d.ts +0 -20
  87. package/dist/hair/appearance.d.ts +0 -29
  88. package/dist/index.cjs +0 -14871
  89. package/dist/index.cjs.map +0 -1
  90. package/dist/interfaces/Animation.d.ts +0 -315
  91. package/dist/interfaces/EmbodyRuntime.d.ts +0 -90
  92. package/dist/interfaces/Hair.d.ts +0 -181
  93. package/dist/interfaces/HairPhysics.d.ts +0 -90
  94. package/dist/interfaces/index.d.ts +0 -11
  95. package/dist/mappings/extendPresetWithProfile.d.ts +0 -17
  96. package/dist/mappings/types.d.ts +0 -309
  97. package/dist/mappings/visemeSystem.d.ts +0 -26
  98. package/dist/physics/HairPhysics.d.ts +0 -86
  99. package/dist/physics/RustHairPhysics.d.ts +0 -18
  100. package/dist/physics/index.d.ts +0 -6
  101. package/dist/preset.cjs +0 -2005
  102. package/dist/preset.cjs.map +0 -1
  103. package/dist/preset.js +0 -2003
  104. package/dist/preset.js.map +0 -1
  105. package/dist/presets/bettaFish.d.ts +0 -328
  106. package/dist/presets/cc4.d.ts +0 -145
  107. package/dist/presets/index.d.ts +0 -30
  108. package/dist/presets/registry.d.ts +0 -57
  109. package/dist/profiles/resolveProfileConfig.d.ts +0 -36
  110. package/dist/profiles/rustResolvedProfile.d.ts +0 -31
  111. package/dist/profiles/types.d.ts +0 -118
  112. package/dist/regions/normalizeRegionTree.d.ts +0 -6
  113. package/dist/regions/regionMapping.d.ts +0 -17
  114. package/dist/regions/types.d.ts +0 -122
  115. package/dist/skeletonTemplates/humanoidSkeletonTemplates.d.ts +0 -32
  116. package/dist/test/setupWasm.d.ts +0 -1
  117. package/dist/three.cjs +0 -9550
  118. package/dist/three.cjs.map +0 -1
  119. package/dist/validation/analyzeModel.d.ts +0 -68
  120. package/dist/validation/extractModelData.d.ts +0 -90
  121. package/dist/validation/generateMappingCorrections.d.ts +0 -32
  122. package/dist/validation/geometryHelpers.d.ts +0 -66
  123. package/dist/validation/types.d.ts +0 -10
  124. package/dist/validation/validateMappings.d.ts +0 -77
  125. package/dist/wasm.cjs +0 -302
  126. package/dist/wasm.cjs.map +0 -1
  127. package/dist/wasmTypes.d.ts +0 -123
@@ -1,118 +0,0 @@
1
- import type { Profile } from '../mappings/types';
2
- import type { PresetType } from '../presets';
3
- import type { LineConfig, MarkerGroup, MarkerStyle, MarkerStyleOverrides, Region } from '../regions/types';
4
- export type ProfileOverrides = Partial<Profile>;
5
- export type ProfilePresetId = PresetType | string;
6
- /**
7
- * Profile-derived runtime config accepted by Embody compatibility helpers.
8
- *
9
- * Embody's canonical model is `Profile`; these fields describe how apps select
10
- * and extend a base profile preset before handing the resolved profile to
11
- * runtime tools.
12
- */
13
- export interface ProfileRuntimeConfig extends Partial<Profile> {
14
- /** Preferred preset/profile id field for new callers. */
15
- profilePresetId?: ProfilePresetId;
16
- /** Compatibility alias for callers already using preset-oriented naming. */
17
- presetId?: ProfilePresetId;
18
- /** Compatibility alias for callers that frame presets as base profiles. */
19
- baseProfileId?: ProfilePresetId;
20
- /** @deprecated Use `profilePresetId` instead. */
21
- auPresetType?: ProfilePresetId;
22
- /**
23
- * Optional legacy nested override blob.
24
- * New stored documents should flatten preset overrides onto the top-level
25
- * profile object instead of nesting them here.
26
- */
27
- profile?: ProfileOverrides;
28
- /** Which annotation region to focus on load. */
29
- defaultRegion?: string;
30
- /** Runtime mirror of `annotationRegions` retained for older camera/marker UIs. */
31
- regions?: Region[];
32
- /** Marker visualization style. Default: '3d'. */
33
- markerStyle?: MarkerStyle;
34
- /** Play intro animation on load. Default: false. */
35
- playIntroOnLoad?: boolean;
36
- /** Model position offset to apply on load. */
37
- modelOffset?: {
38
- x?: number;
39
- y?: number;
40
- z?: number;
41
- };
42
- /** Model rotation in degrees to apply on load. */
43
- modelRotation?: {
44
- x?: number;
45
- y?: number;
46
- z?: number;
47
- };
48
- /**
49
- * Positive finite uniform scale applied to the model root on load.
50
- * Omit this field to preserve the scale authored in the model asset.
51
- */
52
- modelScale?: number;
53
- /** Ensure model's lowest point clears the ground by this amount. */
54
- modelGroundClearance?: number;
55
- /** Baked clip names hidden from downstream UIs and filtered out on load. */
56
- deletedBakedAnimationClips?: string[];
57
- /** Marker groups for fallback behavior. */
58
- markerGroups?: MarkerGroup[];
59
- /** Global line styling defaults. */
60
- lineDefaults?: LineConfig;
61
- /** Global marker style defaults, overridden by per-region style. */
62
- markerDefaults?: Partial<MarkerStyleOverrides>;
63
- }
64
- /**
65
- * Optional downstream app metadata carried next to a profile.
66
- *
67
- * Embody does not treat these as a separate character configuration model; they
68
- * are preserved only for apps that store model records beside profile fields.
69
- */
70
- export interface CharacterProfile extends ProfileRuntimeConfig {
71
- characterId?: string;
72
- characterName?: string;
73
- modelPath?: string;
74
- }
75
- export type ResolvedProfileRuntimeConfig<T extends CharacterProfile = CharacterProfile> = T & Profile & {
76
- annotationRegions?: Region[];
77
- regions?: Region[];
78
- };
79
- export type PresetBackedProfileRuntimeConfig = CharacterProfile & ({
80
- profilePresetId: ProfilePresetId;
81
- } | {
82
- presetId: ProfilePresetId;
83
- } | {
84
- baseProfileId: ProfilePresetId;
85
- } | {
86
- auPresetType: ProfilePresetId;
87
- });
88
- export type CustomProfileRuntimeConfig = CharacterProfile & ({
89
- profilePresetId: 'custom';
90
- } | {
91
- presetId: 'custom';
92
- } | {
93
- baseProfileId: 'custom';
94
- } | {
95
- auPresetType: 'custom';
96
- });
97
- export interface ProfileRegistry {
98
- profiles: CharacterProfile[];
99
- defaultProfile?: string;
100
- }
101
- /**
102
- * @deprecated Use `CharacterProfile` plus `profilePresetId` and
103
- * `annotationRegions`/`regions` instead. This alias is kept for downstream
104
- * apps that still persist LoomLarge-style character records.
105
- */
106
- export type CharacterConfig = CharacterProfile & {
107
- characterId: string;
108
- characterName: string;
109
- modelPath: string;
110
- regions: Region[];
111
- };
112
- /**
113
- * @deprecated Use `ProfileRegistry`.
114
- */
115
- export interface CharacterRegistry {
116
- characters: CharacterConfig[];
117
- defaultCharacter?: string;
118
- }
@@ -1,6 +0,0 @@
1
- export interface RegionTreeNode {
2
- name: string;
3
- parent?: string;
4
- children?: string[];
5
- }
6
- export declare function normalizeRegionTree<T extends RegionTreeNode>(regions?: T[], disabledNames?: string[]): T[] | undefined;
@@ -1,17 +0,0 @@
1
- import * as THREE from 'three';
2
- import type { Region } from './types';
3
- export interface BoneResolutionProfile {
4
- bonePrefix?: string;
5
- boneSuffix?: string;
6
- boneNodes?: Record<string, string>;
7
- suffixPattern?: string;
8
- }
9
- export interface ResolvedFaceCenter {
10
- center: THREE.Vector3;
11
- method: string;
12
- debugInfo: string[];
13
- }
14
- export declare function resolveBoneName(semanticName: string, profile?: BoneResolutionProfile): string;
15
- export declare function resolveBoneNames(names: string[] | undefined, profile?: BoneResolutionProfile): string[];
16
- export declare function fuzzyNameMatch(objectName: string, targetName: string, suffixPattern?: string): boolean;
17
- export declare function resolveFaceCenter(model: THREE.Object3D, region: Region, profile?: BoneResolutionProfile): ResolvedFaceCenter;
@@ -1,122 +0,0 @@
1
- /** Line stroke style */
2
- export type LineStyle = 'solid' | 'dashed' | 'dotted';
3
- /** Line curve type */
4
- export type LineCurve = 'straight' | 'bezier' | 'arc';
5
- /** Named direction presets for line orientation */
6
- export type NamedDirection = 'radial' | 'camera' | 'up' | 'down' | 'left' | 'right' | 'forward' | 'backward';
7
- /** Line configuration for markers */
8
- export interface LineConfig {
9
- /** Stroke style. Default: 'solid' */
10
- style?: LineStyle;
11
- /** Curve type. Default: 'straight' */
12
- curve?: LineCurve;
13
- /** Show arrow head at end. Default: false */
14
- arrowHead?: boolean;
15
- /** Line thickness (affects dash size). Default: 2 */
16
- thickness?: number;
17
- /** Line length override (model units) */
18
- length?: number;
19
- }
20
- /** Style overrides that can be applied per-region */
21
- export interface MarkerStyleOverrides {
22
- /** Override marker sphere color (hex) */
23
- markerColor?: number;
24
- /** Override marker sphere radius (model units) */
25
- markerRadius?: number;
26
- /** Override line color (hex) */
27
- lineColor?: number;
28
- /** Override label text color (CSS) */
29
- labelColor?: string;
30
- /** Override label background (CSS) */
31
- labelBackground?: string;
32
- /** Override label font size (pixels) */
33
- labelFontSize?: number;
34
- /** Override overall marker opacity (0-1) */
35
- opacity?: number;
36
- /** Custom line direction: named preset or explicit vector */
37
- lineDirection?: NamedDirection | {
38
- x: number;
39
- y: number;
40
- z: number;
41
- };
42
- /** Line styling options */
43
- line?: LineConfig;
44
- }
45
- /** Animation style for expanding/collapsing child markers */
46
- export type ExpandAnimation = 'outward' | 'staggered';
47
- /** Expanded region state */
48
- export interface ExpandedRegionState {
49
- regionName: string;
50
- isExpanded: boolean;
51
- children: string[];
52
- }
53
- /** Fallback behavior configuration */
54
- export interface FallbackConfig {
55
- /** Name of the fallback marker to show when all group markers are occluded */
56
- fallbackMarker?: string;
57
- /** Behavior when clicking fallback: 'fit-all' tries to fit all in frame, 'rotate' rotates camera */
58
- clickBehavior?: 'fit-all' | 'rotate';
59
- }
60
- /** Marker group for fallback behavior */
61
- export interface MarkerGroup {
62
- /** Unique group identifier */
63
- groupId: string;
64
- /** Region names in this group */
65
- regions: string[];
66
- /** Fallback configuration */
67
- fallback?: FallbackConfig;
68
- }
69
- /**
70
- * Single annotation region definition - maps a name to geometry targets.
71
- */
72
- export interface AnnotationRegion {
73
- /** Display name for the annotation */
74
- name: string;
75
- /** Bone names to focus on */
76
- bones?: string[];
77
- /** Mesh object names to focus on */
78
- meshes?: string[];
79
- /** Any object names (bones or meshes). Use ['*'] for all objects */
80
- objects?: string[];
81
- /**
82
- * Camera framing multiplier for this annotation.
83
- * Smaller values zoom in tighter; larger values leave more space around the target.
84
- */
85
- paddingFactor?: number;
86
- /**
87
- * Camera angle in degrees around the Y axis (horizontal orbit).
88
- * 0 = front (default), 90 = right side, 180 = back, 270 = left side
89
- */
90
- cameraAngle?: number;
91
- /** Fine-tune camera position offset */
92
- cameraOffset?: {
93
- x?: number;
94
- y?: number;
95
- z?: number;
96
- };
97
- /** Parent region name - children animate outward from parent when expanded */
98
- parent?: string;
99
- /** Child region names - shown when this region is expanded */
100
- children?: string[];
101
- /** Animation style for expand/collapse. Default: 'outward' */
102
- expandAnimation?: ExpandAnimation;
103
- /** Per-marker style overrides */
104
- style?: MarkerStyleOverrides;
105
- /** Marker group ID for fallback behavior */
106
- groupId?: string;
107
- /** If true, this marker acts as a fallback for its group */
108
- isFallback?: boolean;
109
- /** Custom position override (user-adjusted). If set, overrides calculated position. */
110
- customPosition?: {
111
- x: number;
112
- y: number;
113
- z: number;
114
- };
115
- }
116
- export type Region = AnnotationRegion;
117
- /**
118
- * Marker style for annotation visualization
119
- * - 'html': Simple HTML overlay markers with numbered dots directly over targets
120
- * - '3d': 3D markers with lines and labels rendered in scene space
121
- */
122
- export type MarkerStyle = 'html' | '3d';
@@ -1,32 +0,0 @@
1
- import * as THREE from 'three';
2
- export type HumanoidSkeletonTemplateVec3 = readonly [number, number, number];
3
- export type HumanoidSkeletonTemplateBounds = readonly [number, number, number, number, number, number];
4
- export interface HumanoidSkeletonTemplateBone {
5
- readonly name: string;
6
- readonly parent: string | null;
7
- readonly translation: HumanoidSkeletonTemplateVec3;
8
- }
9
- export interface HumanoidSkeletonTemplate {
10
- readonly id: string;
11
- readonly sourceCharacterId: string;
12
- readonly sourceAsset: string;
13
- readonly sourceSkinName: string;
14
- readonly bones: readonly HumanoidSkeletonTemplateBone[];
15
- }
16
- export interface ExtractHumanoidSkeletonTemplateOptions {
17
- readonly id: string;
18
- readonly sourceCharacterId: string;
19
- readonly sourceAsset?: string;
20
- readonly sourceSkinName?: string;
21
- }
22
- export declare const HUMANOID_SKELETON_TEMPLATES: readonly [HumanoidSkeletonTemplate];
23
- export declare const JONATHAN_HUMANOID_SKELETON_TEMPLATE: HumanoidSkeletonTemplate;
24
- export declare function getHumanoidSkeletonTemplate(templateId: string): HumanoidSkeletonTemplate | null;
25
- export declare function getHumanoidSkeletonTemplateBoneNames(template?: HumanoidSkeletonTemplate): string[];
26
- export declare function createValidationSkeletonFromHumanoidTemplate(template?: HumanoidSkeletonTemplate): {
27
- bones: Array<{
28
- name: string;
29
- }>;
30
- };
31
- export declare function computeHumanoidSkeletonTemplateRestBounds(template: HumanoidSkeletonTemplate): HumanoidSkeletonTemplateBounds;
32
- export declare function extractHumanoidSkeletonTemplateFromModel(root: THREE.Object3D, options: ExtractHumanoidSkeletonTemplateOptions): HumanoidSkeletonTemplate;
@@ -1 +0,0 @@
1
- export {};