@lovelace_lol/embody 0.0.13 → 0.0.15

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 (41) hide show
  1. package/README.md +123 -23
  2. package/dist/index.js +1644 -5876
  3. package/dist/index.js.map +1 -1
  4. package/dist/three/annotations/DOMControls.d.ts +5 -1
  5. package/dist/three/annotations/HtmlAnnotationMarkers.d.ts +5 -0
  6. package/dist/three/annotations/OverlayAnnotationMarkers.d.ts +1 -0
  7. package/dist/three/annotations/ThreeAnnotationController.d.ts +145 -0
  8. package/dist/three/annotations/ThreeAnnotationControls.d.ts +42 -0
  9. package/dist/three/annotations/ThreeAnnotationMarkers.d.ts +42 -0
  10. package/dist/three/annotations/ThreeAnnotationRenderer.d.ts +35 -0
  11. package/dist/three/annotations/{DPthree.d.ts → ThreeAnnotations.d.ts} +18 -27
  12. package/dist/three/annotations/adapter.d.ts +2 -8
  13. package/dist/three/annotations/annotationAnchorModel.d.ts +0 -4
  14. package/dist/three/annotations/index.d.ts +9 -8
  15. package/dist/three/annotations/lifecycleBridge.d.ts +26 -0
  16. package/dist/three/annotations/markerVisibilityLifecycle.d.ts +8 -7
  17. package/dist/three/annotations/modelObservation.d.ts +44 -0
  18. package/dist/three/annotations/runtime.d.ts +46 -0
  19. package/dist/three/annotations/runtimeAnnotationPreview.d.ts +2 -2
  20. package/dist/three/annotations/runtimeAnnotationPreviewSide.d.ts +0 -4
  21. package/dist/three/annotations/runtimeAnnotationSidePreview.d.ts +2 -1
  22. package/dist/three/annotations/types.d.ts +7 -8
  23. package/dist/three/authoring.d.ts +4 -0
  24. package/dist/three/authoringTypes.d.ts +7 -0
  25. package/dist/three/characterHost.d.ts +5 -5
  26. package/dist/three/editor/morphVertexPreview.d.ts +3 -2
  27. package/dist/three.js +1644 -5876
  28. package/dist/three.js.map +1 -1
  29. package/dist/wasm/README.md +123 -23
  30. package/dist/wasm/embody_wasm.d.ts +183 -77
  31. package/dist/wasm/embody_wasm.js +455 -2
  32. package/dist/wasm/embody_wasm_bg.wasm +0 -0
  33. package/dist/wasm/embody_wasm_bg.wasm.d.ts +108 -75
  34. package/dist/wasm/index.d.ts +1 -1
  35. package/dist/wasm.js.map +1 -1
  36. package/package.json +2 -2
  37. package/dist/three/annotations/DPthree3DMarkers.d.ts +0 -320
  38. package/dist/three/annotations/DPthreeCameraController.d.ts +0 -415
  39. package/dist/three/annotations/DPthreeHTMLMarkers.d.ts +0 -131
  40. package/dist/three/annotations/DPthreeMarkers.d.ts +0 -52
  41. package/dist/three/annotations/animationFrameTaskScheduler.d.ts +0 -18
@@ -180,9 +180,8 @@ export interface CharacterRegistry {
180
180
  defaultCharacter?: string;
181
181
  }
182
182
  export type AUPresetType = string;
183
- export type DPthreeRegion = AnnotationAnchoredRegion;
184
- export type DPthreeCharacterConfig = AnnotationCharacterConfig;
185
- export type DPthreeRegistry = CharacterRegistry;
183
+ export type AnnotationRegion = AnnotationAnchoredRegion;
184
+ export type AnnotationRegistry = CharacterRegistry;
186
185
  /**
187
186
  * Camera state for save/restore
188
187
  */
@@ -191,16 +190,16 @@ export interface CameraState {
191
190
  target: [number, number, number];
192
191
  }
193
192
  /**
194
- * Configuration for DPthreeCameraController
193
+ * Configuration for ThreeAnnotationController
195
194
  */
196
- export interface DPthreeCameraControllerConfig {
195
+ export interface ThreeAnnotationControllerConfig {
197
196
  /** Optional selection override; otherwise selecting a region focuses the camera. */
198
197
  onRegionSelect?: (name: string) => void;
199
198
  /** Optional host profile intake; defaults to Embody preset resolution. */
200
199
  resolveCharacterConfig?: (config: AnnotationCharacterConfig) => AnnotationCharacterConfig | Promise<AnnotationCharacterConfig>;
201
200
  /** The Three.js camera to control */
202
201
  camera: THREE.PerspectiveCamera;
203
- /** DOM element for OrbitControls (usually the canvas or its container) */
202
+ /** DOM element for Rust camera gestures (usually the canvas or its container) */
204
203
  domElement: HTMLElement;
205
204
  /** The Three.js scene */
206
205
  scene: THREE.Scene;
@@ -258,5 +257,5 @@ export type RegionChangeCallback = (regionName: string) => void;
258
257
  * Callback for character change events
259
258
  */
260
259
  export type CharacterChangeCallback = (config: CharacterConfig) => void;
261
- export type DPthreeRegionChangeCallback = RegionChangeCallback;
262
- export type DPthreeCharacterChangeCallback = CharacterChangeCallback;
260
+ export type AnnotationRegionChangeCallback = RegionChangeCallback;
261
+ export type AnnotationCharacterChangeCallback = CharacterChangeCallback;
@@ -10,6 +10,8 @@ export declare const extendCharacterConfigWithPreset: <T extends Types.ProfileRu
10
10
  export declare const extractProfileOverrides: (config: Types.ProfileRuntimeConfig) => Partial<Types.Profile>;
11
11
  export declare const mergeCharacterRegionsByName: (base?: Region[], override?: Region[]) => Region[];
12
12
  export declare const getMeshNamesForAUProfile: (profile: Types.Profile, auId: number) => string[];
13
+ /** Resolve routing and legacy mesh aliases once for an editor inventory. */
14
+ export declare const resolveMorphMeshSelections: (profile: Partial<Pick<Types.Profile, "morphToMesh" | "visemeMeshCategory">>, categories: string[], availableNames: string[]) => Record<string, Types.MorphMeshSelection>;
13
15
  export declare const getHumanoidSpecification: () => Types.HumanoidSpecification;
14
16
  export declare const setAUMorphTargets: (profile: Types.Profile, auId: number, side: "left" | "right" | "center", targets: Types.MorphTargetRef[]) => Types.Profile;
15
17
  export declare const setHumanoidRoleBinding: (profile: Types.Profile, role: Types.VRMHumanoidRole, boneName: string | null) => Types.Profile;
@@ -34,6 +36,8 @@ export declare const getBoneAxisBindingState: (profile: Types.Profile, boneName:
34
36
  export declare const resolveBoneAxisChannel: (profile: Types.Profile, boneName: string, axis: Types.BoneAxisKey) => Types.RotationChannel;
35
37
  export declare const getBilateralAxisBindingState: (profile: Types.Profile, boneName: string, axis: Types.BoneAxisKey) => Types.BilateralAxisBindingState | null;
36
38
  export declare const getAUBoneBindingState: (profile: Types.Profile, auId: number) => Types.AUBoneBindingState;
39
+ /** Resolve a panel's bone links without repeatedly serializing its full character. */
40
+ export declare const getAUBoneBindingStates: (profile: Partial<Pick<Types.Profile, "auToBones" | "boneNodes" | "bonePrefix" | "boneSuffix" | "suffixPattern" | "compositeRotations" | "continuumPairs" | "humanoidCharacterization">>, auIds: readonly number[]) => Record<number, Types.AUBoneBindingState>;
37
41
  export declare const inferEyeControlScope: (profile: Pick<Types.Profile, "auToBones">, binding: Pick<Types.BoneAxisBindingState, "nodeKey" | "negativeAuId" | "positiveAuId">) => Types.BoneControlScope | null;
38
42
  export declare const inferEyeControlFamily: (binding: Pick<Types.BoneAxisBindingState, "nodeKey" | "axis">) => Types.BoneControlFamily | null;
39
43
  export declare const applyBoneAxisBindingUpdate: (profile: Types.Profile, boneName: string, axis: Types.BoneAxisKey, update: Types.BoneAxisBindingUpdate) => Types.Profile;
@@ -18,6 +18,13 @@ export type BoneControlScope = 'Both Eyes' | 'Left Eye Only' | 'Right Eye Only';
18
18
  export type HumanoidSkeletonTemplateVec3 = readonly [number, number, number];
19
19
  export type HumanoidSkeletonTemplateBounds = readonly [number, number, number, number, number, number];
20
20
  export type MorphTargetRef = string | number;
21
+ export interface MorphMeshSelection {
22
+ category: string;
23
+ /** Includes an explicit empty selection. */
24
+ hasSelection: boolean;
25
+ resolvedNames: string[];
26
+ unresolvedNames: string[];
27
+ }
21
28
  export type MeshCategory = 'body' | 'eye' | 'eyeOcclusion' | 'tearLine' | 'teeth' | 'tongue' | 'hair' | 'eyebrow' | 'cornea' | 'eyelash';
22
29
  export type BlendingMode = 'Normal' | 'Additive' | 'Subtractive' | 'Multiply' | 'None';
23
30
  export interface MorphTargetsBySide {
@@ -3,8 +3,8 @@ import { Embody } from './character';
3
3
  import type { RustEmbodyHostConfig } from './character';
4
4
  import type { CharacterModelLoadOptions, CharacterModelLoadResult, CharacterModelTransform } from './model';
5
5
  import type { CharacterSceneBackend, CharacterSceneConfiguration, CharacterSceneRenderer, CharacterSceneRenderingController, DefaultCharacterSceneAsyncOptions, ReadyDefaultCharacterScene } from './scene';
6
- import { DPthreeCameraController } from './annotations/DPthreeCameraController';
7
- import type { AnnotationCharacterConfig, DPthreeCameraControllerConfig } from './annotations/types';
6
+ import { ThreeAnnotationController } from './annotations/ThreeAnnotationController';
7
+ import type { AnnotationCharacterConfig, ThreeAnnotationControllerConfig } from './annotations/types';
8
8
  import type { Profile } from './authoringTypes';
9
9
  export interface CharacterHostCharacterOptions extends CharacterModelTransform {
10
10
  modelUrl: string;
@@ -34,7 +34,7 @@ export type CharacterHostPreparation = CharacterModelLoadResult & {
34
34
  export type CharacterHostReady = CharacterHostPreparation & {
35
35
  scene: Scene;
36
36
  camera: Camera;
37
- cameraController: DPthreeCameraController | null;
37
+ cameraController: ThreeAnnotationController | null;
38
38
  rendering: CharacterSceneRenderingController | null;
39
39
  };
40
40
  export interface CharacterHostOptions {
@@ -52,7 +52,7 @@ export interface CharacterHostOptions {
52
52
  onCharacterReady?: (context: CharacterHostReady) => void | Promise<void>;
53
53
  /** Default true for compatibility. Editors can retain clips in a lazy catalog. */
54
54
  registerEmbeddedAnimations?: boolean;
55
- camera?: Omit<Partial<DPthreeCameraControllerConfig>, 'scene' | 'camera' | 'renderer' | 'rendering' | 'domElement'>;
55
+ camera?: Omit<Partial<ThreeAnnotationControllerConfig>, 'scene' | 'camera' | 'renderer' | 'rendering' | 'domElement'>;
56
56
  autoStart?: boolean;
57
57
  renderLoop?: boolean;
58
58
  autoFrame?: boolean;
@@ -64,7 +64,7 @@ export interface CharacterHost extends CharacterModelLoadResult {
64
64
  readonly backend: CharacterSceneBackend | null;
65
65
  readonly rendering: CharacterSceneRenderingController | null;
66
66
  camera: Camera;
67
- cameraController: DPthreeCameraController | null;
67
+ cameraController: ThreeAnnotationController | null;
68
68
  lighting: ReadyDefaultCharacterScene['lighting'] | null;
69
69
  ownsScene: boolean;
70
70
  container: HTMLElement;
@@ -15,7 +15,7 @@ export interface MorphVertexPreviewRenderData {
15
15
  }
16
16
  export declare function resolveMorphPreviewMeshes(root: THREE.Object3D, morphName: string, meshNames?: string[]): THREE.Mesh[];
17
17
  export declare function buildMorphVertexPreviewSample(mesh: THREE.Mesh, morphName: string, options?: MorphVertexPreviewOptions): MorphVertexPreviewSample | null;
18
- export declare function buildMorphVertexPreviewRenderData(meshes: THREE.Mesh[], morphName: string, cache: Map<string, MorphVertexPreviewSample>, options?: MorphVertexPreviewOptions): MorphVertexPreviewRenderData | null;
18
+ export declare function buildMorphVertexPreviewRenderData(meshes: THREE.Mesh[], morphName: string, cache: Map<string, MorphVertexPreviewSample>, options?: MorphVertexPreviewOptions, previous?: MorphVertexPreviewRenderData | null): MorphVertexPreviewRenderData | null;
19
19
  /** Editor overlay sampled by the existing Three render loop, without a separate frame timer. */
20
20
  export declare class MorphVertexPreview {
21
21
  private readonly scene;
@@ -23,6 +23,7 @@ export declare class MorphVertexPreview {
23
23
  private readonly cache;
24
24
  private points;
25
25
  private active;
26
+ private renderData;
26
27
  private disposed;
27
28
  private unbindRender;
28
29
  constructor(scene: THREE.Scene, options?: MorphVertexPreviewOptions);
@@ -31,5 +32,5 @@ export declare class MorphVertexPreview {
31
32
  dispose(): void;
32
33
  private createPoints;
33
34
  private update;
34
- private updateAttribute;
35
+ private updateGeometry;
35
36
  }