talking-head-studio 0.4.11 → 0.4.12
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 +279 -193
- package/dist/TalkingHead.d.ts +28 -3
- package/dist/TalkingHead.js +21 -2
- package/dist/TalkingHead.web.d.ts +31 -4
- package/dist/TalkingHead.web.js +11 -1
- package/dist/TalkingHeadVisualization.d.ts +22 -0
- package/dist/TalkingHeadVisualization.js +30 -10
- package/dist/api/studioApi.d.ts +12 -1
- package/dist/api/studioApi.js +16 -2
- package/dist/contract.d.ts +14 -0
- package/dist/contract.js +30 -0
- package/dist/core/avatar/avatarCapabilities.d.ts +60 -0
- package/dist/core/avatar/avatarCapabilities.js +100 -0
- package/dist/core/avatar/backends/gaussian.js +6 -4
- package/dist/core/avatar/motion.d.ts +1713 -0
- package/dist/core/avatar/motion.js +550 -0
- package/dist/core/avatar/motionRuntime.d.ts +46 -0
- package/dist/core/avatar/motionRuntime.js +84 -0
- package/dist/core/avatar/schema.d.ts +33 -5
- package/dist/core/avatar/visemes.d.ts +16 -1
- package/dist/core/avatar/visemes.js +48 -1
- package/dist/editor/AvatarCanvas.js +92 -1
- package/dist/editor/AvatarEditor.native.js +1 -0
- package/dist/editor/AvatarModel.js +1 -0
- package/dist/editor/FaceSqueezeEditor.d.ts +3 -1
- package/dist/editor/FaceSqueezeEditor.js +176 -112
- package/dist/editor/FaceSqueezeEditor.web.d.ts +3 -1
- package/dist/editor/FaceSqueezeEditor.web.js +30 -28
- package/dist/editor/RigidAccessory.js +17 -2
- package/dist/editor/SkinnedClothing.js +1 -0
- package/dist/editor/boneLockedDrag.d.ts +11 -0
- package/dist/editor/boneLockedDrag.js +68 -0
- package/dist/editor/boneSnap.web.d.ts +27 -0
- package/dist/editor/boneSnap.web.js +99 -0
- package/dist/editor/index.web.d.ts +10 -0
- package/dist/editor/index.web.js +26 -0
- package/dist/editor/sounds/haha.wav +0 -0
- package/dist/editor/sounds/owie.wav +0 -0
- package/dist/editor/sounds/stop.wav +0 -0
- package/dist/editor/studioTheme.d.ts +14 -14
- package/dist/editor/studioTheme.js +17 -14
- package/dist/editor/types.d.ts +1 -0
- package/dist/html/accessories.d.ts +7 -0
- package/dist/html/accessories.js +149 -0
- package/dist/html/motion.d.ts +1 -0
- package/dist/html/motion.js +189 -0
- package/dist/html/visemes.d.ts +7 -0
- package/dist/html/visemes.js +348 -0
- package/dist/html.d.ts +1 -1
- package/dist/html.js +55 -732
- package/dist/index.d.ts +7 -3
- package/dist/index.js +17 -1
- package/dist/index.web.d.ts +18 -1
- package/dist/index.web.js +36 -3
- package/dist/sketchfab/api.js +1 -0
- package/dist/sketchfab/glbInspect.d.ts +22 -0
- package/dist/sketchfab/glbInspect.js +58 -0
- package/dist/sketchfab/index.d.ts +3 -0
- package/dist/sketchfab/index.js +8 -1
- package/dist/sketchfab/inspectRemote.d.ts +13 -0
- package/dist/sketchfab/inspectRemote.js +77 -0
- package/dist/sketchfab/types.d.ts +10 -0
- package/dist/studio/AccessoryBrowserScreen.d.ts +6 -0
- package/dist/studio/AccessoryBrowserScreen.js +626 -0
- package/dist/studio/AccessoryPanel.d.ts +10 -0
- package/dist/studio/AccessoryPanel.js +396 -0
- package/dist/studio/AppearancePanel.d.ts +9 -0
- package/dist/studio/AppearancePanel.js +77 -0
- package/dist/studio/AvatarCreatorScreen.d.ts +5 -0
- package/dist/studio/AvatarCreatorScreen.js +806 -0
- package/dist/studio/AvatarEditorScreen.d.ts +14 -0
- package/dist/studio/AvatarEditorScreen.js +510 -0
- package/dist/studio/AvatarGrid.d.ts +23 -0
- package/dist/studio/AvatarGrid.js +257 -0
- package/dist/studio/ColorSwatch.d.ts +8 -0
- package/dist/studio/ColorSwatch.js +100 -0
- package/dist/studio/CreateVoiceProfileSheet.d.ts +8 -0
- package/dist/studio/CreateVoiceProfileSheet.js +242 -0
- package/dist/studio/DetailsPanel.d.ts +15 -0
- package/dist/studio/DetailsPanel.js +239 -0
- package/dist/studio/FilamentEditor.d.ts +2 -0
- package/dist/studio/FilamentEditor.js +6 -0
- package/dist/studio/PrecisionPanel.d.ts +2 -0
- package/dist/studio/PrecisionPanel.js +7 -0
- package/dist/studio/PublicGalleryScreen.d.ts +5 -0
- package/dist/studio/PublicGalleryScreen.js +358 -0
- package/dist/studio/SketchfabModelCard.d.ts +20 -0
- package/dist/studio/SketchfabModelCard.js +104 -0
- package/dist/studio/StudioBrowseHeader.d.ts +9 -0
- package/dist/studio/StudioBrowseHeader.js +28 -0
- package/dist/studio/StudioEmptyState.d.ts +8 -0
- package/dist/studio/StudioEmptyState.js +29 -0
- package/dist/studio/StudioFloatingAction.d.ts +13 -0
- package/dist/studio/StudioFloatingAction.js +42 -0
- package/dist/studio/StudioSectionHeader.d.ts +7 -0
- package/dist/studio/StudioSectionHeader.js +27 -0
- package/dist/studio/StudioSurfaceCard.d.ts +8 -0
- package/dist/studio/StudioSurfaceCard.js +20 -0
- package/dist/studio/VoicePanel.d.ts +15 -0
- package/dist/studio/VoicePanel.js +305 -0
- package/dist/studio/constants.d.ts +3 -0
- package/dist/studio/constants.js +6 -0
- package/dist/studio/index.d.ts +29 -0
- package/dist/studio/index.js +54 -0
- package/dist/studio/useSketchfabCapabilities.d.ts +31 -0
- package/dist/studio/useSketchfabCapabilities.js +82 -0
- package/dist/tts/useDirectVisemeStream.js +15 -10
- package/dist/utils/avatarUtils.js +92 -5
- package/dist/utils/faceLandmarkerToShapeWeights.js +2 -4
- package/dist/voice/useAudioPlayer.js +17 -4
- package/dist/voice/useVoicePreview.js +4 -2
- package/dist/wardrobe/index.d.ts +1 -0
- package/dist/wardrobe/index.js +6 -1
- package/dist/wardrobe/useAccessoryGestures.d.ts +20 -0
- package/dist/wardrobe/useAccessoryGestures.js +94 -0
- package/dist/wardrobe/useAvatarWardrobeHydration.js +8 -2
- package/dist/wardrobe/useStudioAvatar.js +11 -2
- package/dist/wardrobe/wardrobeStore.d.ts +2 -0
- package/dist/wardrobe/wardrobeStore.js +12 -2
- package/dist/wgpu/R3FWebGpuCanvas.d.ts +15 -0
- package/dist/wgpu/R3FWebGpuCanvas.js +176 -0
- package/dist/wgpu/WgpuAvatar.d.ts +26 -2
- package/dist/wgpu/WgpuAvatar.js +296 -39
- package/dist/wgpu/accessoryDefaults.d.ts +12 -0
- package/dist/wgpu/accessoryDefaults.js +19 -0
- package/dist/wgpu/blobShim.d.ts +2 -0
- package/dist/wgpu/blobShim.js +191 -0
- package/dist/wgpu/index.d.ts +1 -0
- package/dist/wgpu/index.js +4 -1
- package/dist/wgpu/loadGLTFFromUri.d.ts +2 -0
- package/dist/wgpu/loadGLTFFromUri.js +75 -0
- package/dist/wgpu/morphTables.js +21 -10
- package/dist/wgpu/motionState.d.ts +20 -0
- package/dist/wgpu/motionState.js +31 -0
- package/dist/wgpu/patchThreeForRN.d.ts +28 -0
- package/dist/wgpu/patchThreeForRN.js +292 -0
- package/dist/wgpu/scenePlacement.d.ts +5 -0
- package/dist/wgpu/scenePlacement.js +50 -0
- package/dist/wgpu/useAuthedModelUri.js +4 -2
- package/dist/wgpu/useNativeGLTF.d.ts +7 -0
- package/dist/wgpu/useNativeGLTF.js +36 -0
- package/package.json +97 -31
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { OculusViseme, ArkitBlendShape, AgentVisemePayload, VisemeCue } from './core/avatar/visemes';
|
|
2
|
-
export { OCULUS_VISEMES, ARKIT_TO_OCULUS, remapArkitToOculus, getArkitWeightsForViseme } from './core/avatar/visemes';
|
|
1
|
+
export type { EngineVisemeMappingArtifact, OculusViseme, OculusVisemeWeights, RhubarbViseme, ArkitBlendShape, AgentVisemePayload, VisemeCue } from './core/avatar/visemes';
|
|
2
|
+
export { ENGINE_VISEME_MAPPING, OCULUS_MORPH_TARGET_NAMES, OCULUS_VISEMES, RHUBARB_TO_OCULUS, RHUBARB_VISEMES, ARKIT_TO_OCULUS, oculusWeightsForRhubarbCue, remapArkitToOculus, getArkitWeightsForViseme } from './core/avatar/visemes';
|
|
3
3
|
export type { FaceControl, ExpressionState, HeadPose, EyeGaze, Viseme } from './core/avatar/faceControls';
|
|
4
4
|
export { createNeutralExpression, visemeToExpression, applyVisemeToExpression } from './core/avatar/faceControls';
|
|
5
5
|
export type { AvatarBackend, CalibrationProfile, AvatarRenderTarget } from './core/avatar/backend';
|
|
@@ -7,7 +7,11 @@ export { MorphTargetBackend } from './core/avatar/backends';
|
|
|
7
7
|
export { GaussianBackend } from './core/avatar/backends';
|
|
8
8
|
export type { GaussianBackendConfig } from './core/avatar/backends';
|
|
9
9
|
export { walkAvatarSchema } from './core/avatar/schema';
|
|
10
|
-
export type { AvatarSchemaReport, MorphCoverage, SkeletonInfo, MeshStats, VísemeTier } from './core/avatar/schema';
|
|
10
|
+
export type { AvatarSchemaReport, MorphCoverage, SkeletonInfo, MeshStats, VisemeTier, VísemeTier } from './core/avatar/schema';
|
|
11
|
+
export { inspectAvatarCapabilities, inspectAvatarGltf, inspectAvatarJsonChunk, parseGlbJson } from './core/avatar/avatarCapabilities';
|
|
12
|
+
export type { AvatarCapabilities, MotionCoverage } from './core/avatar/avatarCapabilities';
|
|
13
|
+
export { MOTION_DEFS, MOTION_KEYS, isMotionKey, TALKINGHEAD_GESTURES, TALKINGHEAD_POSES, } from './core/avatar/motion';
|
|
14
|
+
export type { MotionKey, MotionDef, MotionDefWithBones, MotionBoneKey, MotionOscillator, TalkingHeadGesture, TalkingHeadPose, } from './core/avatar/motion';
|
|
11
15
|
export { TalkingHead } from './TalkingHead';
|
|
12
16
|
export type { TalkingHeadRef, TalkingHeadProps, TalkingHeadMood, TalkingHeadAccessory, TalkingHeadLoadingState, TalkingHeadLoadingStage, TalkingHeadViseme, TalkingHeadVisemeCue, TalkingHeadVisemeSchedule, AvatarPlayerProps, AvatarPlayerRef, } from './TalkingHead';
|
|
13
17
|
export { TalkingHeadVisualization } from './TalkingHeadVisualization';
|
package/dist/index.js
CHANGED
|
@@ -14,10 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useFaceControlsFromVisemes = exports.useMotionMarkers = exports.useDirectVisemeStream = exports.normalizeAppearance = exports.pickTargetForMaterialName = exports.applyAppearanceToObject3D = exports.TalkingHeadVisualization = exports.TalkingHead = exports.walkAvatarSchema = exports.GaussianBackend = exports.MorphTargetBackend = exports.applyVisemeToExpression = exports.visemeToExpression = exports.createNeutralExpression = exports.getArkitWeightsForViseme = exports.remapArkitToOculus = exports.ARKIT_TO_OCULUS = exports.OCULUS_VISEMES = void 0;
|
|
17
|
+
exports.useFaceControlsFromVisemes = exports.useMotionMarkers = exports.useDirectVisemeStream = exports.normalizeAppearance = exports.pickTargetForMaterialName = exports.applyAppearanceToObject3D = exports.TalkingHeadVisualization = exports.TalkingHead = exports.TALKINGHEAD_POSES = exports.TALKINGHEAD_GESTURES = exports.isMotionKey = exports.MOTION_KEYS = exports.MOTION_DEFS = exports.parseGlbJson = exports.inspectAvatarJsonChunk = exports.inspectAvatarGltf = exports.inspectAvatarCapabilities = exports.walkAvatarSchema = exports.GaussianBackend = exports.MorphTargetBackend = exports.applyVisemeToExpression = exports.visemeToExpression = exports.createNeutralExpression = exports.getArkitWeightsForViseme = exports.remapArkitToOculus = exports.oculusWeightsForRhubarbCue = exports.ARKIT_TO_OCULUS = exports.RHUBARB_VISEMES = exports.RHUBARB_TO_OCULUS = exports.OCULUS_VISEMES = exports.OCULUS_MORPH_TARGET_NAMES = exports.ENGINE_VISEME_MAPPING = void 0;
|
|
18
18
|
var visemes_1 = require("./core/avatar/visemes");
|
|
19
|
+
Object.defineProperty(exports, "ENGINE_VISEME_MAPPING", { enumerable: true, get: function () { return visemes_1.ENGINE_VISEME_MAPPING; } });
|
|
20
|
+
Object.defineProperty(exports, "OCULUS_MORPH_TARGET_NAMES", { enumerable: true, get: function () { return visemes_1.OCULUS_MORPH_TARGET_NAMES; } });
|
|
19
21
|
Object.defineProperty(exports, "OCULUS_VISEMES", { enumerable: true, get: function () { return visemes_1.OCULUS_VISEMES; } });
|
|
22
|
+
Object.defineProperty(exports, "RHUBARB_TO_OCULUS", { enumerable: true, get: function () { return visemes_1.RHUBARB_TO_OCULUS; } });
|
|
23
|
+
Object.defineProperty(exports, "RHUBARB_VISEMES", { enumerable: true, get: function () { return visemes_1.RHUBARB_VISEMES; } });
|
|
20
24
|
Object.defineProperty(exports, "ARKIT_TO_OCULUS", { enumerable: true, get: function () { return visemes_1.ARKIT_TO_OCULUS; } });
|
|
25
|
+
Object.defineProperty(exports, "oculusWeightsForRhubarbCue", { enumerable: true, get: function () { return visemes_1.oculusWeightsForRhubarbCue; } });
|
|
21
26
|
Object.defineProperty(exports, "remapArkitToOculus", { enumerable: true, get: function () { return visemes_1.remapArkitToOculus; } });
|
|
22
27
|
Object.defineProperty(exports, "getArkitWeightsForViseme", { enumerable: true, get: function () { return visemes_1.getArkitWeightsForViseme; } });
|
|
23
28
|
var faceControls_1 = require("./core/avatar/faceControls");
|
|
@@ -30,6 +35,17 @@ var backends_2 = require("./core/avatar/backends");
|
|
|
30
35
|
Object.defineProperty(exports, "GaussianBackend", { enumerable: true, get: function () { return backends_2.GaussianBackend; } });
|
|
31
36
|
var schema_1 = require("./core/avatar/schema");
|
|
32
37
|
Object.defineProperty(exports, "walkAvatarSchema", { enumerable: true, get: function () { return schema_1.walkAvatarSchema; } });
|
|
38
|
+
var avatarCapabilities_1 = require("./core/avatar/avatarCapabilities");
|
|
39
|
+
Object.defineProperty(exports, "inspectAvatarCapabilities", { enumerable: true, get: function () { return avatarCapabilities_1.inspectAvatarCapabilities; } });
|
|
40
|
+
Object.defineProperty(exports, "inspectAvatarGltf", { enumerable: true, get: function () { return avatarCapabilities_1.inspectAvatarGltf; } });
|
|
41
|
+
Object.defineProperty(exports, "inspectAvatarJsonChunk", { enumerable: true, get: function () { return avatarCapabilities_1.inspectAvatarJsonChunk; } });
|
|
42
|
+
Object.defineProperty(exports, "parseGlbJson", { enumerable: true, get: function () { return avatarCapabilities_1.parseGlbJson; } });
|
|
43
|
+
var motion_1 = require("./core/avatar/motion");
|
|
44
|
+
Object.defineProperty(exports, "MOTION_DEFS", { enumerable: true, get: function () { return motion_1.MOTION_DEFS; } });
|
|
45
|
+
Object.defineProperty(exports, "MOTION_KEYS", { enumerable: true, get: function () { return motion_1.MOTION_KEYS; } });
|
|
46
|
+
Object.defineProperty(exports, "isMotionKey", { enumerable: true, get: function () { return motion_1.isMotionKey; } });
|
|
47
|
+
Object.defineProperty(exports, "TALKINGHEAD_GESTURES", { enumerable: true, get: function () { return motion_1.TALKINGHEAD_GESTURES; } });
|
|
48
|
+
Object.defineProperty(exports, "TALKINGHEAD_POSES", { enumerable: true, get: function () { return motion_1.TALKINGHEAD_POSES; } });
|
|
33
49
|
// TalkingHead component + legacy type re-exports
|
|
34
50
|
var TalkingHead_1 = require("./TalkingHead");
|
|
35
51
|
Object.defineProperty(exports, "TalkingHead", { enumerable: true, get: function () { return TalkingHead_1.TalkingHead; } });
|
package/dist/index.web.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
export type { TalkingHeadAccessory, TalkingHeadLoadingState, TalkingHeadMood, TalkingHeadProps, TalkingHeadRef, } from './TalkingHead.web';
|
|
1
|
+
export type { AvatarPlayerProps, AvatarPlayerRef, TalkingHeadAccessory, TalkingHeadLoadingStage, TalkingHeadLoadingState, TalkingHeadMood, TalkingHeadProps, TalkingHeadRef, TalkingHeadViseme, TalkingHeadVisemeCue, TalkingHeadVisemeSchedule, } from './TalkingHead.web';
|
|
2
2
|
export { TalkingHead } from './TalkingHead.web';
|
|
3
|
+
export { buildAvatarHtml } from './html';
|
|
4
|
+
export type { AvatarConfig } from './html';
|
|
5
|
+
export type { EngineVisemeMappingArtifact, OculusViseme, OculusVisemeWeights, RhubarbViseme, ArkitBlendShape, AgentVisemePayload, VisemeCue } from './core/avatar/visemes';
|
|
6
|
+
export { ENGINE_VISEME_MAPPING, OCULUS_MORPH_TARGET_NAMES, OCULUS_VISEMES, RHUBARB_TO_OCULUS, RHUBARB_VISEMES, ARKIT_TO_OCULUS, oculusWeightsForRhubarbCue, remapArkitToOculus, getArkitWeightsForViseme } from './core/avatar/visemes';
|
|
7
|
+
export type { FaceControl, ExpressionState, HeadPose, EyeGaze, Viseme } from './core/avatar/faceControls';
|
|
8
|
+
export { createNeutralExpression, visemeToExpression, applyVisemeToExpression } from './core/avatar/faceControls';
|
|
9
|
+
export type { AvatarBackend, CalibrationProfile, AvatarRenderTarget } from './core/avatar/backend';
|
|
10
|
+
export { MorphTargetBackend } from './core/avatar/backends';
|
|
11
|
+
export { GaussianBackend } from './core/avatar/backends';
|
|
12
|
+
export type { GaussianBackendConfig } from './core/avatar/backends';
|
|
13
|
+
export { walkAvatarSchema } from './core/avatar/schema';
|
|
14
|
+
export type { AvatarSchemaReport, MorphCoverage, SkeletonInfo, MeshStats, VisemeTier, VísemeTier } from './core/avatar/schema';
|
|
15
|
+
export { MOTION_DEFS, MOTION_KEYS, isMotionKey, TALKINGHEAD_GESTURES, TALKINGHEAD_POSES, } from './core/avatar/motion';
|
|
16
|
+
export type { MotionKey, MotionDef, MotionDefWithBones, MotionBoneKey, MotionOscillator, TalkingHeadGesture, TalkingHeadPose, } from './core/avatar/motion';
|
|
3
17
|
export { applyAppearanceToObject3D } from './appearance/apply';
|
|
4
18
|
export { pickTargetForMaterialName } from './appearance/matchers';
|
|
5
19
|
export { normalizeAppearance } from './appearance/schema';
|
|
@@ -7,3 +21,6 @@ export type { AppearanceTarget } from './appearance/matchers';
|
|
|
7
21
|
export * from './api';
|
|
8
22
|
export { useDirectVisemeStream } from './tts/useDirectVisemeStream';
|
|
9
23
|
export type { VisemeStreamPayload } from './tts/useDirectVisemeStream';
|
|
24
|
+
export { useMotionMarkers } from './tts/useMotionMarkers';
|
|
25
|
+
export { useFaceControlsFromVisemes } from './voice/useFaceControls';
|
|
26
|
+
export type { AvatarGlbParams, AvatarPlatformApi } from './platform/api/types';
|
package/dist/index.web.js
CHANGED
|
@@ -14,17 +14,50 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useDirectVisemeStream = exports.normalizeAppearance = exports.pickTargetForMaterialName = exports.applyAppearanceToObject3D = exports.TalkingHead = void 0;
|
|
17
|
+
exports.useFaceControlsFromVisemes = exports.useMotionMarkers = exports.useDirectVisemeStream = exports.normalizeAppearance = exports.pickTargetForMaterialName = exports.applyAppearanceToObject3D = exports.TALKINGHEAD_POSES = exports.TALKINGHEAD_GESTURES = exports.isMotionKey = exports.MOTION_KEYS = exports.MOTION_DEFS = exports.walkAvatarSchema = exports.GaussianBackend = exports.MorphTargetBackend = exports.applyVisemeToExpression = exports.visemeToExpression = exports.createNeutralExpression = exports.getArkitWeightsForViseme = exports.remapArkitToOculus = exports.oculusWeightsForRhubarbCue = exports.ARKIT_TO_OCULUS = exports.RHUBARB_VISEMES = exports.RHUBARB_TO_OCULUS = exports.OCULUS_VISEMES = exports.OCULUS_MORPH_TARGET_NAMES = exports.ENGINE_VISEME_MAPPING = exports.buildAvatarHtml = exports.TalkingHead = void 0;
|
|
18
18
|
var TalkingHead_web_1 = require("./TalkingHead.web");
|
|
19
19
|
Object.defineProperty(exports, "TalkingHead", { enumerable: true, get: function () { return TalkingHead_web_1.TalkingHead; } });
|
|
20
|
+
var html_1 = require("./html");
|
|
21
|
+
Object.defineProperty(exports, "buildAvatarHtml", { enumerable: true, get: function () { return html_1.buildAvatarHtml; } });
|
|
22
|
+
var visemes_1 = require("./core/avatar/visemes");
|
|
23
|
+
Object.defineProperty(exports, "ENGINE_VISEME_MAPPING", { enumerable: true, get: function () { return visemes_1.ENGINE_VISEME_MAPPING; } });
|
|
24
|
+
Object.defineProperty(exports, "OCULUS_MORPH_TARGET_NAMES", { enumerable: true, get: function () { return visemes_1.OCULUS_MORPH_TARGET_NAMES; } });
|
|
25
|
+
Object.defineProperty(exports, "OCULUS_VISEMES", { enumerable: true, get: function () { return visemes_1.OCULUS_VISEMES; } });
|
|
26
|
+
Object.defineProperty(exports, "RHUBARB_TO_OCULUS", { enumerable: true, get: function () { return visemes_1.RHUBARB_TO_OCULUS; } });
|
|
27
|
+
Object.defineProperty(exports, "RHUBARB_VISEMES", { enumerable: true, get: function () { return visemes_1.RHUBARB_VISEMES; } });
|
|
28
|
+
Object.defineProperty(exports, "ARKIT_TO_OCULUS", { enumerable: true, get: function () { return visemes_1.ARKIT_TO_OCULUS; } });
|
|
29
|
+
Object.defineProperty(exports, "oculusWeightsForRhubarbCue", { enumerable: true, get: function () { return visemes_1.oculusWeightsForRhubarbCue; } });
|
|
30
|
+
Object.defineProperty(exports, "remapArkitToOculus", { enumerable: true, get: function () { return visemes_1.remapArkitToOculus; } });
|
|
31
|
+
Object.defineProperty(exports, "getArkitWeightsForViseme", { enumerable: true, get: function () { return visemes_1.getArkitWeightsForViseme; } });
|
|
32
|
+
var faceControls_1 = require("./core/avatar/faceControls");
|
|
33
|
+
Object.defineProperty(exports, "createNeutralExpression", { enumerable: true, get: function () { return faceControls_1.createNeutralExpression; } });
|
|
34
|
+
Object.defineProperty(exports, "visemeToExpression", { enumerable: true, get: function () { return faceControls_1.visemeToExpression; } });
|
|
35
|
+
Object.defineProperty(exports, "applyVisemeToExpression", { enumerable: true, get: function () { return faceControls_1.applyVisemeToExpression; } });
|
|
36
|
+
var backends_1 = require("./core/avatar/backends");
|
|
37
|
+
Object.defineProperty(exports, "MorphTargetBackend", { enumerable: true, get: function () { return backends_1.MorphTargetBackend; } });
|
|
38
|
+
var backends_2 = require("./core/avatar/backends");
|
|
39
|
+
Object.defineProperty(exports, "GaussianBackend", { enumerable: true, get: function () { return backends_2.GaussianBackend; } });
|
|
40
|
+
var schema_1 = require("./core/avatar/schema");
|
|
41
|
+
Object.defineProperty(exports, "walkAvatarSchema", { enumerable: true, get: function () { return schema_1.walkAvatarSchema; } });
|
|
42
|
+
var motion_1 = require("./core/avatar/motion");
|
|
43
|
+
Object.defineProperty(exports, "MOTION_DEFS", { enumerable: true, get: function () { return motion_1.MOTION_DEFS; } });
|
|
44
|
+
Object.defineProperty(exports, "MOTION_KEYS", { enumerable: true, get: function () { return motion_1.MOTION_KEYS; } });
|
|
45
|
+
Object.defineProperty(exports, "isMotionKey", { enumerable: true, get: function () { return motion_1.isMotionKey; } });
|
|
46
|
+
Object.defineProperty(exports, "TALKINGHEAD_GESTURES", { enumerable: true, get: function () { return motion_1.TALKINGHEAD_GESTURES; } });
|
|
47
|
+
Object.defineProperty(exports, "TALKINGHEAD_POSES", { enumerable: true, get: function () { return motion_1.TALKINGHEAD_POSES; } });
|
|
20
48
|
// Export appearance utilities, but exclude AvatarAppearance — the canonical
|
|
21
49
|
// AvatarAppearance (with equippedAccessories) comes from ./api below.
|
|
22
50
|
var apply_1 = require("./appearance/apply");
|
|
23
51
|
Object.defineProperty(exports, "applyAppearanceToObject3D", { enumerable: true, get: function () { return apply_1.applyAppearanceToObject3D; } });
|
|
24
52
|
var matchers_1 = require("./appearance/matchers");
|
|
25
53
|
Object.defineProperty(exports, "pickTargetForMaterialName", { enumerable: true, get: function () { return matchers_1.pickTargetForMaterialName; } });
|
|
26
|
-
var
|
|
27
|
-
Object.defineProperty(exports, "normalizeAppearance", { enumerable: true, get: function () { return
|
|
54
|
+
var schema_2 = require("./appearance/schema");
|
|
55
|
+
Object.defineProperty(exports, "normalizeAppearance", { enumerable: true, get: function () { return schema_2.normalizeAppearance; } });
|
|
28
56
|
__exportStar(require("./api"), exports);
|
|
29
57
|
var useDirectVisemeStream_1 = require("./tts/useDirectVisemeStream");
|
|
30
58
|
Object.defineProperty(exports, "useDirectVisemeStream", { enumerable: true, get: function () { return useDirectVisemeStream_1.useDirectVisemeStream; } });
|
|
59
|
+
var useMotionMarkers_1 = require("./tts/useMotionMarkers");
|
|
60
|
+
Object.defineProperty(exports, "useMotionMarkers", { enumerable: true, get: function () { return useMotionMarkers_1.useMotionMarkers; } });
|
|
61
|
+
// Face controls hook
|
|
62
|
+
var useFaceControls_1 = require("./voice/useFaceControls");
|
|
63
|
+
Object.defineProperty(exports, "useFaceControlsFromVisemes", { enumerable: true, get: function () { return useFaceControls_1.useFaceControlsFromVisemes; } });
|
package/dist/sketchfab/api.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight GLB inspection — reads the JSON chunk header only, no geometry.
|
|
3
|
+
*
|
|
4
|
+
* Used to detect whether a downloaded model has morph targets (blend shapes)
|
|
5
|
+
* before importing it. Models without morph targets can't do real lipsync;
|
|
6
|
+
* we fall back to jaw-bone animation, which is much worse.
|
|
7
|
+
*/
|
|
8
|
+
/** Byte length of the GLB JSON chunk, or null if not a valid GLB header. */
|
|
9
|
+
export declare function glbJsonChunkLength(header: Uint8Array): number | null;
|
|
10
|
+
export interface GlbMorphInfo {
|
|
11
|
+
/** Total morph targets across all mesh primitives. */
|
|
12
|
+
morphTargetCount: number;
|
|
13
|
+
/** Names from mesh.extras.targetNames where present (lowercased). */
|
|
14
|
+
targetNames: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Inspect a glTF JSON document (the parsed JSON chunk of a GLB) for morph
|
|
18
|
+
* targets. Returns counts and any declared target names.
|
|
19
|
+
*/
|
|
20
|
+
export declare function inspectGltfMorphs(gltf: unknown): GlbMorphInfo;
|
|
21
|
+
/** Parse the JSON chunk bytes of a GLB and inspect morph targets. */
|
|
22
|
+
export declare function inspectGlbJsonChunk(jsonBytes: Uint8Array): GlbMorphInfo;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight GLB inspection — reads the JSON chunk header only, no geometry.
|
|
4
|
+
*
|
|
5
|
+
* Used to detect whether a downloaded model has morph targets (blend shapes)
|
|
6
|
+
* before importing it. Models without morph targets can't do real lipsync;
|
|
7
|
+
* we fall back to jaw-bone animation, which is much worse.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.glbJsonChunkLength = glbJsonChunkLength;
|
|
11
|
+
exports.inspectGltfMorphs = inspectGltfMorphs;
|
|
12
|
+
exports.inspectGlbJsonChunk = inspectGlbJsonChunk;
|
|
13
|
+
const GLB_MAGIC = 0x46546c67; // 'glTF'
|
|
14
|
+
const CHUNK_JSON = 0x4e4f534a; // 'JSON'
|
|
15
|
+
/** Byte length of the GLB JSON chunk, or null if not a valid GLB header. */
|
|
16
|
+
function glbJsonChunkLength(header) {
|
|
17
|
+
if (header.length < 20)
|
|
18
|
+
return null;
|
|
19
|
+
const view = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
20
|
+
if (view.getUint32(0, true) !== GLB_MAGIC)
|
|
21
|
+
return null;
|
|
22
|
+
if (view.getUint32(16, true) !== CHUNK_JSON)
|
|
23
|
+
return null;
|
|
24
|
+
return view.getUint32(12, true);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Inspect a glTF JSON document (the parsed JSON chunk of a GLB) for morph
|
|
28
|
+
* targets. Returns counts and any declared target names.
|
|
29
|
+
*/
|
|
30
|
+
function inspectGltfMorphs(gltf) {
|
|
31
|
+
const info = { morphTargetCount: 0, targetNames: [] };
|
|
32
|
+
const meshes = gltf?.meshes;
|
|
33
|
+
if (!Array.isArray(meshes))
|
|
34
|
+
return info;
|
|
35
|
+
for (const mesh of meshes) {
|
|
36
|
+
const primitives = mesh?.primitives;
|
|
37
|
+
if (Array.isArray(primitives)) {
|
|
38
|
+
for (const prim of primitives) {
|
|
39
|
+
const targets = prim?.targets;
|
|
40
|
+
if (Array.isArray(targets))
|
|
41
|
+
info.morphTargetCount += targets.length;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const names = mesh?.extras?.targetNames;
|
|
45
|
+
if (Array.isArray(names)) {
|
|
46
|
+
for (const n of names) {
|
|
47
|
+
if (typeof n === 'string')
|
|
48
|
+
info.targetNames.push(n.toLowerCase());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return info;
|
|
53
|
+
}
|
|
54
|
+
/** Parse the JSON chunk bytes of a GLB and inspect morph targets. */
|
|
55
|
+
function inspectGlbJsonChunk(jsonBytes) {
|
|
56
|
+
const text = new TextDecoder().decode(jsonBytes);
|
|
57
|
+
return inspectGltfMorphs(JSON.parse(text));
|
|
58
|
+
}
|
|
@@ -2,5 +2,8 @@ export { searchSketchfab, getDownloadUrl, downloadModel, getBestThumbnail } from
|
|
|
2
2
|
export type { SketchfabSearchOptions } from './api';
|
|
3
3
|
export { useSketchfabSearch } from './useSketchfabSearch';
|
|
4
4
|
export type { UseSketchfabSearchOptions, UseSketchfabSearchResult } from './useSketchfabSearch';
|
|
5
|
+
export { glbJsonChunkLength, inspectGlbJsonChunk, inspectGltfMorphs } from './glbInspect';
|
|
6
|
+
export type { GlbMorphInfo } from './glbInspect';
|
|
7
|
+
export { inspectAvatarFromUrl, fetchSketchfabCapabilities } from './inspectRemote';
|
|
5
8
|
export { ACCESSORY_CATEGORIES, HUMANOID_TAGS } from './categories';
|
|
6
9
|
export type { SketchfabModel, SketchfabResponse, AccessoryCategory } from './types';
|
package/dist/sketchfab/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HUMANOID_TAGS = exports.ACCESSORY_CATEGORIES = exports.useSketchfabSearch = exports.getBestThumbnail = exports.downloadModel = exports.getDownloadUrl = exports.searchSketchfab = void 0;
|
|
3
|
+
exports.HUMANOID_TAGS = exports.ACCESSORY_CATEGORIES = exports.fetchSketchfabCapabilities = exports.inspectAvatarFromUrl = exports.inspectGltfMorphs = exports.inspectGlbJsonChunk = exports.glbJsonChunkLength = exports.useSketchfabSearch = exports.getBestThumbnail = exports.downloadModel = exports.getDownloadUrl = exports.searchSketchfab = void 0;
|
|
4
4
|
var api_1 = require("./api");
|
|
5
5
|
Object.defineProperty(exports, "searchSketchfab", { enumerable: true, get: function () { return api_1.searchSketchfab; } });
|
|
6
6
|
Object.defineProperty(exports, "getDownloadUrl", { enumerable: true, get: function () { return api_1.getDownloadUrl; } });
|
|
@@ -8,6 +8,13 @@ Object.defineProperty(exports, "downloadModel", { enumerable: true, get: functio
|
|
|
8
8
|
Object.defineProperty(exports, "getBestThumbnail", { enumerable: true, get: function () { return api_1.getBestThumbnail; } });
|
|
9
9
|
var useSketchfabSearch_1 = require("./useSketchfabSearch");
|
|
10
10
|
Object.defineProperty(exports, "useSketchfabSearch", { enumerable: true, get: function () { return useSketchfabSearch_1.useSketchfabSearch; } });
|
|
11
|
+
var glbInspect_1 = require("./glbInspect");
|
|
12
|
+
Object.defineProperty(exports, "glbJsonChunkLength", { enumerable: true, get: function () { return glbInspect_1.glbJsonChunkLength; } });
|
|
13
|
+
Object.defineProperty(exports, "inspectGlbJsonChunk", { enumerable: true, get: function () { return glbInspect_1.inspectGlbJsonChunk; } });
|
|
14
|
+
Object.defineProperty(exports, "inspectGltfMorphs", { enumerable: true, get: function () { return glbInspect_1.inspectGltfMorphs; } });
|
|
15
|
+
var inspectRemote_1 = require("./inspectRemote");
|
|
16
|
+
Object.defineProperty(exports, "inspectAvatarFromUrl", { enumerable: true, get: function () { return inspectRemote_1.inspectAvatarFromUrl; } });
|
|
17
|
+
Object.defineProperty(exports, "fetchSketchfabCapabilities", { enumerable: true, get: function () { return inspectRemote_1.fetchSketchfabCapabilities; } });
|
|
11
18
|
var categories_1 = require("./categories");
|
|
12
19
|
Object.defineProperty(exports, "ACCESSORY_CATEGORIES", { enumerable: true, get: function () { return categories_1.ACCESSORY_CATEGORIES; } });
|
|
13
20
|
Object.defineProperty(exports, "HUMANOID_TAGS", { enumerable: true, get: function () { return categories_1.HUMANOID_TAGS; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AvatarCapabilities } from '../core/avatar/avatarCapabilities';
|
|
2
|
+
/**
|
|
3
|
+
* Capability report for a GLB at `glbUrl`, read via two small Range requests
|
|
4
|
+
* (header, then JSON chunk). Returns null when the model can't be cheaply
|
|
5
|
+
* inspected (no Range support, bad header, oversized/short JSON chunk, network
|
|
6
|
+
* error or abort) — callers treat null as "unknown", never as "bad".
|
|
7
|
+
*/
|
|
8
|
+
export declare function inspectAvatarFromUrl(glbUrl: string, signal?: AbortSignal): Promise<AvatarCapabilities | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a Sketchfab model's signed GLB URL and inspect its capabilities
|
|
11
|
+
* without a full download. Returns null on any failure ("unknown").
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchSketchfabCapabilities(uid: string, apiKey: string, signal?: AbortSignal): Promise<AvatarCapabilities | null>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inspectAvatarFromUrl = inspectAvatarFromUrl;
|
|
4
|
+
exports.fetchSketchfabCapabilities = fetchSketchfabCapabilities;
|
|
5
|
+
/**
|
|
6
|
+
* Remote (pre-download) avatar capability inspection for Sketchfab results.
|
|
7
|
+
*
|
|
8
|
+
* Reads only the GLB header + JSON chunk via HTTP Range requests so we can tell
|
|
9
|
+
* whether a search result can lip-sync + move BEFORE the user commits to a full
|
|
10
|
+
* download/import. This is what lets the picker float "good-first" avatars to
|
|
11
|
+
* the top and badge them.
|
|
12
|
+
*
|
|
13
|
+
* Safety: a host that ignores Range and replies 200 would stream the whole file
|
|
14
|
+
* (models go up to 50MB), so we bail unless the response is a 206 Partial
|
|
15
|
+
* Content. The JSON chunk holds only metadata (nodes/meshes/skins/accessors),
|
|
16
|
+
* not geometry, so it stays small even for dense rigs.
|
|
17
|
+
*/
|
|
18
|
+
const glbInspect_1 = require("./glbInspect");
|
|
19
|
+
const api_1 = require("./api");
|
|
20
|
+
const avatarCapabilities_1 = require("../core/avatar/avatarCapabilities");
|
|
21
|
+
/** Sanity cap on the JSON chunk we'll pull before giving up (treated as
|
|
22
|
+
* "unknown"). Real avatar JSON chunks are well under this. */
|
|
23
|
+
const MAX_JSON_CHUNK_BYTES = 8 * 1024 * 1024;
|
|
24
|
+
async function rangeBytes(url, start, endInclusive, signal) {
|
|
25
|
+
const res = await fetch(url, {
|
|
26
|
+
headers: { Range: `bytes=${start}-${endInclusive}` },
|
|
27
|
+
signal,
|
|
28
|
+
});
|
|
29
|
+
// Require a partial response. A 200 means the host ignored Range and is about
|
|
30
|
+
// to hand us the entire file — abandon the body so we never pull 50MB.
|
|
31
|
+
if (res.status !== 206) {
|
|
32
|
+
const body = res.body;
|
|
33
|
+
if (body?.cancel) {
|
|
34
|
+
try {
|
|
35
|
+
await body.cancel();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
/* best effort */
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return new Uint8Array(await res.arrayBuffer());
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Capability report for a GLB at `glbUrl`, read via two small Range requests
|
|
47
|
+
* (header, then JSON chunk). Returns null when the model can't be cheaply
|
|
48
|
+
* inspected (no Range support, bad header, oversized/short JSON chunk, network
|
|
49
|
+
* error or abort) — callers treat null as "unknown", never as "bad".
|
|
50
|
+
*/
|
|
51
|
+
async function inspectAvatarFromUrl(glbUrl, signal) {
|
|
52
|
+
try {
|
|
53
|
+
const header = await rangeBytes(glbUrl, 0, 19, signal);
|
|
54
|
+
if (!header)
|
|
55
|
+
return null;
|
|
56
|
+
const jsonLen = (0, glbInspect_1.glbJsonChunkLength)(header);
|
|
57
|
+
if (jsonLen === null || jsonLen <= 0 || jsonLen > MAX_JSON_CHUNK_BYTES)
|
|
58
|
+
return null;
|
|
59
|
+
const jsonBytes = await rangeBytes(glbUrl, 20, 20 + jsonLen - 1, signal);
|
|
60
|
+
if (!jsonBytes || jsonBytes.length < jsonLen)
|
|
61
|
+
return null;
|
|
62
|
+
return (0, avatarCapabilities_1.inspectAvatarJsonChunk)(jsonBytes);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Resolve a Sketchfab model's signed GLB URL and inspect its capabilities
|
|
70
|
+
* without a full download. Returns null on any failure ("unknown").
|
|
71
|
+
*/
|
|
72
|
+
async function fetchSketchfabCapabilities(uid, apiKey, signal) {
|
|
73
|
+
const url = await (0, api_1.getDownloadUrl)(uid, apiKey);
|
|
74
|
+
if (!url)
|
|
75
|
+
return null;
|
|
76
|
+
return inspectAvatarFromUrl(url, signal);
|
|
77
|
+
}
|
|
@@ -29,6 +29,16 @@ export interface SketchfabModel {
|
|
|
29
29
|
label: string;
|
|
30
30
|
} | null;
|
|
31
31
|
isDownloadable: boolean;
|
|
32
|
+
archives?: {
|
|
33
|
+
glb?: {
|
|
34
|
+
size: number;
|
|
35
|
+
url?: string;
|
|
36
|
+
};
|
|
37
|
+
gltf?: {
|
|
38
|
+
size: number;
|
|
39
|
+
url?: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
32
42
|
}
|
|
33
43
|
export interface SketchfabResponse {
|
|
34
44
|
results: SketchfabModel[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface AccessoryBrowserScreenProps {
|
|
2
|
+
avatarId?: string;
|
|
3
|
+
sketchfabApiKey: string;
|
|
4
|
+
onDone?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function AccessoryBrowserScreen({ avatarId, sketchfabApiKey, onDone, }: AccessoryBrowserScreenProps): import("react/jsx-runtime").JSX.Element;
|