@lovelace_lol/embody 0.0.11 → 0.0.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.
@@ -4,7 +4,7 @@ import type { Region } from './annotations/types';
4
4
  import type * as Types from './authoringTypes';
5
5
  export * from './authoringTypes';
6
6
  export { resolveBoneNames, fuzzyNameMatch } from './annotations/adapter';
7
- export { DEFAULT_AXIS_TO_CHANNEL, DEFAULT_BONE_MAX_DEGREES, JOINT_CONTROL_SECTION, VISEME_KEYS, HAIR_COLOR_PRESETS, DEFAULT_HAIR_COLOR_APPEARANCE, HUMANOID_SKELETON_TEMPLATES, CC4_HUMANOID_SKELETON_TEMPLATE, } from '@lovelace_lol/embody/wasm';
7
+ export { DEFAULT_AXIS_TO_CHANNEL, DEFAULT_BONE_MAX_DEGREES, JOINT_CONTROL_SECTION, VISEME_KEYS, HAIR_COLOR_PRESETS, DEFAULT_HAIR_COLOR_APPEARANCE, getAUDescriptors, LEGACY_BODY_CONTROL_AUS, HUMANOID_SKELETON_TEMPLATES, CC4_HUMANOID_SKELETON_TEMPLATE, } from '@lovelace_lol/embody/wasm';
8
8
  export declare const getPreset: (id: Types.PresetType) => Types.Profile;
9
9
  export declare const extendCharacterConfigWithPreset: <T extends Types.ProfileRuntimeConfig>(config: T) => T;
10
10
  export declare const extractProfileOverrides: (config: Types.ProfileRuntimeConfig) => Partial<Types.Profile>;
@@ -61,7 +61,6 @@ export declare const classifyAuAsJointControl: (profile: Types.Profile, auId: nu
61
61
  nodeKey?: string | null;
62
62
  }) => Types.Profile;
63
63
  export declare const resolveContinuumDisplayLabel: (profile: Pick<Types.Profile, "continuumPairs" | "continuumLabels" | "auInfo" | "boneNodes" | "bonePrefix" | "boneSuffix">, negativeAuId: number, positiveAuId: number) => string;
64
- export declare function getBodyControls(profile: Types.Profile, model?: Object3D): Types.BodyControlDescriptor[];
65
64
  export declare function extractModelData(model: Object3D, meshes?: Mesh[], animations?: AnimationClip[]): Types.ModelData;
66
65
  export declare function analyzeModel(options: {
67
66
  source: {
@@ -93,3 +92,4 @@ export declare function extractHumanoidSkeletonTemplateFromModel(model: Object3D
93
92
  sourceAsset?: string;
94
93
  sourceSkinName?: string;
95
94
  }): Types.HumanoidSkeletonTemplate;
95
+ export type { AUDescriptor } from '@lovelace_lol/embody/wasm';
@@ -207,95 +207,6 @@ export interface HumanoidCharacterizationResolution {
207
207
  warnings: string[];
208
208
  valid: boolean;
209
209
  }
210
- /** Semantic body actions reuse the AU bone/morph evaluator. VRM names identify targets. */
211
- export interface BodyControlDefinition {
212
- label: string;
213
- section: string;
214
- auId: number;
215
- negativeAuId?: number | null;
216
- bilateral: boolean;
217
- roles: VRMHumanoidRole[];
218
- order?: number;
219
- }
220
- export interface BodyControlDescriptor {
221
- id: string;
222
- label: string;
223
- section: string;
224
- auId: number;
225
- negativeAuId: number | null;
226
- auIds: number[];
227
- bilateral: boolean;
228
- roles: VRMHumanoidRole[];
229
- order: number;
230
- boneBindings: Array<BoneBinding & {
231
- auId: number;
232
- boneName: string;
233
- }>;
234
- morphBindings: MorphTargetsBySide;
235
- meshNames: string[];
236
- hasBones: boolean;
237
- hasMorphs: boolean;
238
- isMixed: boolean;
239
- available: boolean;
240
- diagnostics: string[];
241
- }
242
- /** Pose values are normalized authored action amounts, never world Euler angles. */
243
- export interface SemanticPoseChannel {
244
- intensity: number;
245
- /** -1 = character's left, 0 = both, +1 = character's right. */
246
- balance?: number;
247
- /** Morph contribution only; bone activation remains intensity. Defaults to profile. */
248
- morphStrength?: number;
249
- }
250
- export interface SemanticPose {
251
- version: 1;
252
- controls: Array<{
253
- controlId: string;
254
- positive?: SemanticPoseChannel;
255
- negative?: SemanticPoseChannel;
256
- }>;
257
- }
258
- export interface SemanticPoseDirection {
259
- auId: number;
260
- label: string;
261
- available: boolean;
262
- availableSides?: Array<'left' | 'right' | 'center'>;
263
- hasBones: boolean;
264
- hasMorphs: boolean;
265
- morphStrength: number;
266
- }
267
- export interface SemanticPoseControl {
268
- id: string;
269
- label: string;
270
- section: string;
271
- roles: string[];
272
- bilateral: boolean;
273
- boneNames: string[];
274
- morphNames: string[];
275
- positive: SemanticPoseDirection;
276
- negative?: SemanticPoseDirection;
277
- }
278
- export interface SemanticAnimation {
279
- version: 1;
280
- durationSeconds: number;
281
- tracks: Array<{
282
- controlId: string;
283
- direction: 'positive' | 'negative';
284
- balance?: number;
285
- morphStrength?: number;
286
- keyframes: Array<{
287
- time: number;
288
- intensity: number;
289
- }>;
290
- }>;
291
- }
292
- export interface SemanticAnimationOptions extends Record<string, unknown> {
293
- faceCurves?: Record<string, Array<{
294
- time: number;
295
- intensity: number;
296
- inherit?: boolean;
297
- }>>;
298
- }
299
210
  export interface Profile {
300
211
  name?: string;
301
212
  animalType?: string;
@@ -340,8 +251,6 @@ export interface Profile {
340
251
  disabledRegions?: string[];
341
252
  hairPhysics?: HairPhysicsProfileConfig;
342
253
  humanoidCharacterization?: HumanoidCharacterization;
343
- /** Authored overrides may patch individual fields; null removes a preset control. */
344
- bodyControls?: Record<string, Partial<BodyControlDefinition> | null>;
345
254
  }
346
255
  export interface ProfileRuntimeConfig extends Partial<Profile> {
347
256
  profilePresetId?: PresetType;
@@ -1,5 +1,6 @@
1
1
  import { AnimationClip } from 'three';
2
2
  import type { Mesh, Object3D } from 'three';
3
+ import type { AUDescriptor } from '@lovelace_lol/embody/wasm';
3
4
  import { ThreeFrameApplier } from './index';
4
5
  import type { ThreeModelInspection } from './index';
5
6
  import type { ThreeModelReferencePose } from './reference-pose';
@@ -122,7 +123,6 @@ export declare class Embody {
122
123
  snippetToClip(name: string, curves: JsonObject, options?: CharacterPlaybackOptions): CharacterPlaybackHandle;
123
124
  buildTypedClip(name: string, channels: any[], options?: CharacterPlaybackOptions): CharacterPlaybackHandle;
124
125
  typedSnippetToClip(name: string, channels: any[], options?: CharacterPlaybackOptions): CharacterPlaybackHandle;
125
- semanticAnimationToClip(name: string, animation: JsonObject, options?: CharacterPlaybackOptions): CharacterPlaybackHandle;
126
126
  playSnippet(snippet: string | {
127
127
  name: string;
128
128
  curves: JsonObject;
@@ -164,13 +164,7 @@ export declare class Embody {
164
164
  setAU(id: number, value: number, balance?: number): void;
165
165
  getAU(id: number): number;
166
166
  getAUBalance(id: number): number;
167
- getBodyControls(): any[];
168
- getSemanticPoseCatalog(): any[];
169
- captureSemanticPose(): JsonObject;
170
- validateSemanticPose(pose: JsonObject): JsonObject;
171
- applySemanticPose(pose: JsonObject): void;
172
- validateSemanticAnimation(animation: JsonObject, options?: JsonObject): void;
173
- resetBodyControls(): void;
167
+ getAUDescriptors(): AUDescriptor[];
174
168
  setContinuum(negative: number, positive: number, value: number, balance?: number): void;
175
169
  getContinuum(negative: number, positive: number): number;
176
170
  transitionAU(id: number, value: number, durationMs?: number, balance?: number): CharacterTransitionHandle;
package/dist/three.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as THREE3 from 'three';
2
2
  import { NoBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, NormalBlending, Vector3, Box3, Timer, Matrix4, AnimationMixer, AdditiveAnimationBlendMode, NormalAnimationBlendMode, LoopOnce, LoopRepeat, LoopPingPong, PropertyBinding, Euler, Quaternion, AnimationUtils, InterpolateDiscrete, InterpolateLinear, MathUtils, Mesh, PlaneGeometry, ShadowMaterial, HemisphereLight, DirectionalLight, SRGBColorSpace, ACESFilmicToneMapping, WebGLRenderer, Scene, Color, PerspectiveCamera, PCFShadowMap, PCFSoftShadowMap, NumberKeyframeTrack, QuaternionKeyframeTrack, VectorKeyframeTrack, AnimationClip, PMREMGenerator, FloatType, Float32BufferAttribute, BufferAttribute, WebGPUCoordinateSystem, WebGLCoordinateSystem } from 'three';
3
3
  import { CC4_HUMANOID_SKELETON_TEMPLATE, HUMANOID_SKELETON_TEMPLATES, DEFAULT_HAIR_COLOR_APPEARANCE, initEmbodyCore, requireInitializedEmbodyCore } from '@lovelace_lol/embody/wasm';
4
- export { CC4_HUMANOID_SKELETON_TEMPLATE, DEFAULT_AXIS_TO_CHANNEL, DEFAULT_BONE_MAX_DEGREES, DEFAULT_HAIR_COLOR_APPEARANCE, HAIR_COLOR_PRESETS, HUMANOID_SKELETON_TEMPLATES, JOINT_CONTROL_SECTION, VISEME_KEYS } from '@lovelace_lol/embody/wasm';
4
+ export { CC4_HUMANOID_SKELETON_TEMPLATE, DEFAULT_AXIS_TO_CHANNEL, DEFAULT_BONE_MAX_DEGREES, DEFAULT_HAIR_COLOR_APPEARANCE, HAIR_COLOR_PRESETS, HUMANOID_SKELETON_TEMPLATES, JOINT_CONTROL_SECTION, LEGACY_BODY_CONTROL_AUS, VISEME_KEYS, getAUDescriptors } from '@lovelace_lol/embody/wasm';
5
5
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
6
6
  import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
7
7
  import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js';
@@ -6582,9 +6582,6 @@ var resolveContinuumDisplayLabel = (profile, negativeAuId, positiveAuId) => requ
6582
6582
  function inspectModel(model, meshes, profile) {
6583
6583
  return new ThreeModelInspector().inspectModel(model, { meshes, profile });
6584
6584
  }
6585
- function getBodyControls(profile, model) {
6586
- return request2("profile.getBodyControls", { profile, ...model ? { model: inspectModel(model, void 0, profile).descriptor } : {} });
6587
- }
6588
6585
  function extractModelData(model, meshes, animations = []) {
6589
6586
  const inspection = inspectModel(model, meshes);
6590
6587
  return JSON.parse(requireInitializedEmbodyCore().extract_model_data_json(json(inspection.descriptor), json(serializeAnimationClips(model, animations, inspection))));
@@ -7436,12 +7433,10 @@ var Embody = class _Embody {
7436
7433
  return parse(this.core.build_clip(source.name, json2(source.input), json2(buildOptions)));
7437
7434
  case "typed":
7438
7435
  return parse(this.core.build_typed_clip(source.name, json2(source.input), json2(buildOptions)));
7439
- case "semantic":
7440
- return parse(this.core.build_semantic_clip(source.name, json2(source.input), json2(buildOptions)));
7441
7436
  case "compiled":
7442
7437
  return source.clip;
7443
7438
  case "native":
7444
- throw new Error("Native animation sources do not require semantic compilation.");
7439
+ throw new Error("Native animation sources do not require AU compilation.");
7445
7440
  }
7446
7441
  }
7447
7442
  restValues(track) {
@@ -7880,7 +7875,8 @@ var Embody = class _Embody {
7880
7875
  return this.handle(source, options, play);
7881
7876
  }
7882
7877
  buildClip(name, curves, options = {}) {
7883
- return options.semanticAnimation ? this.semanticAnimationToClip(name, options.semanticAnimation, { ...options, faceCurves: curves }) : this.build({ name, kind: "curves", input: copy(curves), options: copy(options) }, options, false);
7878
+ if (options.semanticAnimation) throw new Error("Decode legacy named animation tracks to numeric AU curves before building a clip.");
7879
+ return this.build({ name, kind: "curves", input: copy(curves), options: copy(options) }, options, false);
7884
7880
  }
7885
7881
  snippetToClip(name, curves, options = {}) {
7886
7882
  return this.buildClip(name, curves, options);
@@ -7891,9 +7887,6 @@ var Embody = class _Embody {
7891
7887
  typedSnippetToClip(name, channels, options = {}) {
7892
7888
  return this.buildTypedClip(name, channels, options);
7893
7889
  }
7894
- semanticAnimationToClip(name, animation, options = {}) {
7895
- return this.build({ name, kind: "semantic", input: copy(animation), options: copy(options) }, options, false);
7896
- }
7897
7890
  playSnippet(snippet, curvesOrOptions = {}, options = {}) {
7898
7891
  return typeof snippet === "string" ? this.buildClip(snippet, curvesOrOptions, options).play() : this.buildClip(snippet.name, snippet.curves, curvesOrOptions).play();
7899
7892
  }
@@ -8103,26 +8096,8 @@ var Embody = class _Embody {
8103
8096
  getAUBalance(id) {
8104
8097
  return this.core.get_au_balance(id);
8105
8098
  }
8106
- getBodyControls() {
8107
- return parse(this.core.get_body_controls_json());
8108
- }
8109
- getSemanticPoseCatalog() {
8110
- return parse(this.core.get_semantic_pose_catalog_json());
8111
- }
8112
- captureSemanticPose() {
8113
- return parse(this.core.capture_semantic_pose_json());
8114
- }
8115
- validateSemanticPose(pose) {
8116
- return parse(this.core.validate_semantic_pose_json(json2(pose)));
8117
- }
8118
- applySemanticPose(pose) {
8119
- this.mutateLive(() => this.core.apply_semantic_pose_json(json2(pose)));
8120
- }
8121
- validateSemanticAnimation(animation, options = {}) {
8122
- this.core.validate_semantic_animation_json(json2(animation), json2(options));
8123
- }
8124
- resetBodyControls() {
8125
- this.mutateLive(() => this.core.reset_body_controls());
8099
+ getAUDescriptors() {
8100
+ return parse(this.core.get_au_descriptors_json());
8126
8101
  }
8127
8102
  setContinuum(negative, positive, value, balance = NaN) {
8128
8103
  this.mutateLive(() => this.core.set_continuum(negative, positive, value, balance));
@@ -9983,6 +9958,6 @@ var collectMorphMeshes = (root) => {
9983
9958
  return meshes;
9984
9959
  };
9985
9960
 
9986
- export { BLENDING_MODES, CHARACTER_SCENE_TYPES, CHARACTER_SCENE_TYPE_IDS, DPthreeCameraController as CameraController, CameraDOMControls, CameraDOMControls as Controls, DEFAULT_CHARACTER_LIGHTING_PRESETS, DEFAULT_CHARACTER_LIGHTING_PRESET_ID, DEFAULT_CHARACTER_LIGHTING_PRESET_IDS, DEFAULT_CHARACTER_LIGHTING_SETTINGS, DEFAULT_CHARACTER_SCENE_TYPE_ID, DEFAULT_MARKER_AUTO_HIDE_MS, DEFAULT_PREVIEW_AUTO_CLEAR_MS, DPthree, DPthree3DMarkers, DPthreeCameraController, DPthreeHTMLMarkers, DPthreeMarkers, Embody, DPthree3DMarkers as Markers3D, DPthreeHTMLMarkers as MarkersHTML, RUNTIME_ANNOTATION_REGION_PREFIX, RustAnnotationCameraCore, THREE_BLENDING_MODES, ThreeFrameApplier, ThreeModelInspector, ThreeNativePlaybackConnector, analyzeModel, applyAUBoneBindingUpdate, applyBilateralAxisBindingUpdate, applyBoneAxisBindingUpdate, applyCharacterModelTransform, bindModelReferencePose, boneResolutionProfile, buildBoneAuOptions, buildRegionDisplayOptions, captureModelReferencePose, classifyAuAsJointControl, collectMorphMeshes, computeHumanoidSkeletonTemplateRestBounds, createAnimationClipFromClipIR, createBilateralBoneAxisAu, createBoneAxisAu, createCharacterHost, createDefaultCharacterLighting, createDefaultCharacterScene, createDefaultCharacterSceneAsync, createDefaultCharacterSceneRuntime, createMarkerLifecycleRevealOptions, createMarkerVisibilityLifecycle, createRuntimeAnnotationPreviewLifecycle, createRustAnnotationCameraCore, createRustEmbodyHost, createRustEmbodyHostUnbound, createScenePlaybackFrame, createShadowPlane, createValidationSkeletonFromHumanoidTemplate, detectAnnotationLaterality, disposeCharacterModel, ensureBilateralBoneNodeKeys, ensureBoneNodeKey, extendCharacterConfigWithPreset, extendModelReferencePose, extractHumanoidSkeletonTemplateFromModel, extractModelData, extractProfileOverrides, filterCameraViewRegions, findNodeKeyForBone, formatAxisDirectionLabel, formatAxisLabel, fuzzyNameMatch, getAUBoneBindingState, getAxisFromChannel, getBilateralAxisBindingState, getBodyControls, getBoneAxisBindingState, getDefaultAnnotationLaterality, getHumanoidSkeletonTemplate, getHumanoidSkeletonTemplateBoneNames, getHumanoidSpecification, getMeshNamesForAUProfile, getModelLocalOrbitAngle, getPreset, getRuntimeAUMeshSideOffset, getRuntimeAUMorphAnchorPoint, getRuntimeAnnotationSide, getSemanticHorizontalSign, getSemanticHorizontalSignForSide, getWorldDirectionForCameraAngle, hasLeftRightMorphs, inferChiralBoneNamePair, inferEyeControlFamily, inferEyeControlScope, inferRuntimeAnnotationPreviewSide, isJointControlAuInfo, isMaxDegreesOnlyAxisBindingUpdate, isMixedAU, isRuntimeAnnotationRegionName, loadCharacterModel, mergeCharacterRegionsByName, normalizeDefaultCharacterLightingSettings, normalizeHairColorAppearance, parseCharacterModel, passesMarkerCameraAngleGate, pickContinuumAnnotationAuId, renderScenePlayback, resolveAnnotationCharacterConfig, resolveBoneAxisChannel, resolveBoneNameForNodeKey, resolveBoneNames, resolveContinuumDisplayLabel, resolveFaceCenter, resolveHumanoidCharacterization, resolveMarkerAnchorRegion, resolveRegionCameraAngle, resolveRegionVisibilityCameraAngle, resolveVisemeProfile, serializeAnimationClips, setAUMorphTargets, setHumanoidRoleBinding, shouldProjectMarkerAnchorToSurface, shouldUseFaceCenterForMarkerAnchor, stripConfiguredBoneAffixes, supportsRustEmbodyPreset, toWorldDirection, validateHumanoidCharacterization, validateMappings };
9961
+ export { BLENDING_MODES, CHARACTER_SCENE_TYPES, CHARACTER_SCENE_TYPE_IDS, DPthreeCameraController as CameraController, CameraDOMControls, CameraDOMControls as Controls, DEFAULT_CHARACTER_LIGHTING_PRESETS, DEFAULT_CHARACTER_LIGHTING_PRESET_ID, DEFAULT_CHARACTER_LIGHTING_PRESET_IDS, DEFAULT_CHARACTER_LIGHTING_SETTINGS, DEFAULT_CHARACTER_SCENE_TYPE_ID, DEFAULT_MARKER_AUTO_HIDE_MS, DEFAULT_PREVIEW_AUTO_CLEAR_MS, DPthree, DPthree3DMarkers, DPthreeCameraController, DPthreeHTMLMarkers, DPthreeMarkers, Embody, DPthree3DMarkers as Markers3D, DPthreeHTMLMarkers as MarkersHTML, RUNTIME_ANNOTATION_REGION_PREFIX, RustAnnotationCameraCore, THREE_BLENDING_MODES, ThreeFrameApplier, ThreeModelInspector, ThreeNativePlaybackConnector, analyzeModel, applyAUBoneBindingUpdate, applyBilateralAxisBindingUpdate, applyBoneAxisBindingUpdate, applyCharacterModelTransform, bindModelReferencePose, boneResolutionProfile, buildBoneAuOptions, buildRegionDisplayOptions, captureModelReferencePose, classifyAuAsJointControl, collectMorphMeshes, computeHumanoidSkeletonTemplateRestBounds, createAnimationClipFromClipIR, createBilateralBoneAxisAu, createBoneAxisAu, createCharacterHost, createDefaultCharacterLighting, createDefaultCharacterScene, createDefaultCharacterSceneAsync, createDefaultCharacterSceneRuntime, createMarkerLifecycleRevealOptions, createMarkerVisibilityLifecycle, createRuntimeAnnotationPreviewLifecycle, createRustAnnotationCameraCore, createRustEmbodyHost, createRustEmbodyHostUnbound, createScenePlaybackFrame, createShadowPlane, createValidationSkeletonFromHumanoidTemplate, detectAnnotationLaterality, disposeCharacterModel, ensureBilateralBoneNodeKeys, ensureBoneNodeKey, extendCharacterConfigWithPreset, extendModelReferencePose, extractHumanoidSkeletonTemplateFromModel, extractModelData, extractProfileOverrides, filterCameraViewRegions, findNodeKeyForBone, formatAxisDirectionLabel, formatAxisLabel, fuzzyNameMatch, getAUBoneBindingState, getAxisFromChannel, getBilateralAxisBindingState, getBoneAxisBindingState, getDefaultAnnotationLaterality, getHumanoidSkeletonTemplate, getHumanoidSkeletonTemplateBoneNames, getHumanoidSpecification, getMeshNamesForAUProfile, getModelLocalOrbitAngle, getPreset, getRuntimeAUMeshSideOffset, getRuntimeAUMorphAnchorPoint, getRuntimeAnnotationSide, getSemanticHorizontalSign, getSemanticHorizontalSignForSide, getWorldDirectionForCameraAngle, hasLeftRightMorphs, inferChiralBoneNamePair, inferEyeControlFamily, inferEyeControlScope, inferRuntimeAnnotationPreviewSide, isJointControlAuInfo, isMaxDegreesOnlyAxisBindingUpdate, isMixedAU, isRuntimeAnnotationRegionName, loadCharacterModel, mergeCharacterRegionsByName, normalizeDefaultCharacterLightingSettings, normalizeHairColorAppearance, parseCharacterModel, passesMarkerCameraAngleGate, pickContinuumAnnotationAuId, renderScenePlayback, resolveAnnotationCharacterConfig, resolveBoneAxisChannel, resolveBoneNameForNodeKey, resolveBoneNames, resolveContinuumDisplayLabel, resolveFaceCenter, resolveHumanoidCharacterization, resolveMarkerAnchorRegion, resolveRegionCameraAngle, resolveRegionVisibilityCameraAngle, resolveVisemeProfile, serializeAnimationClips, setAUMorphTargets, setHumanoidRoleBinding, shouldProjectMarkerAnchorToSurface, shouldUseFaceCenterForMarkerAnchor, stripConfiguredBoneAffixes, supportsRustEmbodyPreset, toWorldDirection, validateHumanoidCharacterization, validateMappings };
9987
9962
  //# sourceMappingURL=three.js.map
9988
9963
  //# sourceMappingURL=three.js.map