@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.
package/README.md CHANGED
@@ -294,7 +294,7 @@ step/linear clip conversion, and remaining import work.
294
294
 
295
295
  `humanoid.getSpecification` exposes all 55 VRM 1.0 anatomical roles and their
296
296
  parent/required rules. CC4 maps all 55 to distinct authored bones and supplies
297
- 58 body controls for fingers, wrists, shoulders, feet, whole body motion, the
297
+ authored AU mappings for fingers, wrists, shoulders, feet, whole body motion, the
298
298
  spine, head, eyes and jaw. `profile.setHumanoidRoleBinding` edits or clears a role and
299
299
  retargets its existing actuators. The runtime keeps the same bone/morph evaluator;
300
300
  other rigs must author their own calibrated axes/ranges and optional muscle
@@ -525,42 +525,27 @@ the package; CI checks and publishes that same build.
525
525
 
526
526
  MIT. See [LICENSE](LICENSE) and [AUTHORS.md](AUTHORS.md).
527
527
 
528
- ### Semantic poses and generated motion
529
-
530
- `RuntimeCore.get_semantic_pose_catalog_json()` returns the configured profile's
531
- motion identifiers, direction labels, VRM roles, resolved bone/morph names and
532
- per-direction model support and available sides. VRM names anatomy; profile motion IDs name authored
533
- actions. Hosts should send only supported directions to generation prompts,
534
- along with their bounds: intensity and morph strength `0..1`, bilateral balance
535
- `-1` character-left, `0` both, `1` character-right. Amounts are normalized authored
536
- motion, not radians or world-space rotation.
537
-
538
- `capture_semantic_pose_json()` returns `{version:1,controls:[{controlId,positive,
539
- negative?}]}`. Each direction stores intensity, balance and morphStrength
540
- independently, preserving opposed action values. These are manual runtime
541
- controls; capturing an arbitrary mixer/baked pose would require pose inference.
542
- `validate_semantic_pose_json()` fills omitted settings without mutation.
543
- `apply_semantic_pose_json()` validates the complete input before replacing Body
544
- actions, preserving unrelated facial state. Either direction may be omitted;
545
- a control requires at least one. Known missing outputs remain portable to partial
546
- rigs; unknown IDs, duplicate actions and invalid bounds fail. Applying a semantic pose releases prior direct overrides on its exact mapped
547
- mesh/target IDs, preserving unrelated facial overrides and same-named targets on
548
- unmapped meshes.
549
-
550
- `build_semantic_clip(name, animationJson, optionsJson)` compiles
551
- `{version:1,durationSeconds,tracks:[{controlId,direction,balance?,morphStrength?,
552
- keyframes:[{time,intensity}]}]}` through the same AU/bone/morph evaluator.
553
- Direction is `positive` or `negative`; time is seconds. Unsupported directions,
554
- unknown controls, duplicate actions and non-increasing/out-of-range keys fail.
555
- `options.faceCurves` accepts additional non-Body AU curves so face and body compile
556
- together, including overlapping mapped bones. Compilation preserves live state;
557
- per-track morph strength changes only the compiled output. The host mixer owns
558
- playback and interpolation, as with existing snippets.
559
-
560
- Catalog `availableSides` identifies actual mapped left/right/center outputs.
561
- Generated animations reject a negative balance without a left output or positive
562
- balance without a right output; balance zero may drive the remaining side of a
563
- partial rig. Stored static poses retain their portability across missing outputs.
564
- `evaluate_semantic_body_bone_frame()` returns exact Body-owned properties including
565
- neutral values, allowing an explicit semantic pose/reset to replace old raw bone
566
- edits without touching unrelated properties.
528
+ ### AU controls and authored animation
529
+
530
+ Character controls come from the character's saved `auInfo`/`actionInfo`,
531
+ `auToBones`, `auToMorphs`, `compositeRotations` and `continuumPairs`. There is
532
+ no named body-control catalog or fixed control count. `engine.getAUDescriptors()`
533
+ and initialized `getAUDescriptors(profile, modelDescriptor?)` return per-AU
534
+ metadata and resolved output support, including labels, signed pair IDs,
535
+ bilateral sides, saved morph strength and resolved bone/morph names.
536
+
537
+ Use `setAU`/`transitionAU`, `setContinuum`, `getAUBalance` and
538
+ `setAUMixWeight` for live controls. `buildClip`/`playSnippet` compile numeric
539
+ AU curves through the same saved bone/morph evaluator; `balanceMap` and
540
+ `mixWeights` are per-AU compilation options. Compilation preserves live state.
541
+ Native playback owns interpolation, pause, resume, cancellation and blending.
542
+ Reset an authored control by setting its mapped AU values to zero. Hosts select
543
+ which mapped AU IDs to reset; unrelated face state and saved mix strengths remain
544
+ under their existing owners.
545
+
546
+ Named semantic pose/animation APIs and profile `bodyControls` are retired.
547
+ Persisted named records must be decoded at the storage boundary to numeric AU
548
+ values/curves, using their original profile mappings. `LEGACY_BODY_CONTROL_AUS`
549
+ is a deprecated reader-only historical identity snapshot for old CC4 records;
550
+ it is never consulted for current controls, actuation or profile compilation.
551
+ Unknown legacy names must be reported rather than silently omitted.
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ 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
4
  export * from '@lovelace_lol/embody/wasm';
5
- 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';
5
+ 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';
6
6
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
7
7
  import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
8
8
  import { FBXLoader } from 'three/examples/jsm/loaders/FBXLoader.js';
@@ -6583,9 +6583,6 @@ var resolveContinuumDisplayLabel = (profile, negativeAuId, positiveAuId) => requ
6583
6583
  function inspectModel(model, meshes, profile) {
6584
6584
  return new ThreeModelInspector().inspectModel(model, { meshes, profile });
6585
6585
  }
6586
- function getBodyControls(profile, model) {
6587
- return request2("profile.getBodyControls", { profile, ...model ? { model: inspectModel(model, void 0, profile).descriptor } : {} });
6588
- }
6589
6586
  function extractModelData(model, meshes, animations = []) {
6590
6587
  const inspection = inspectModel(model, meshes);
6591
6588
  return JSON.parse(requireInitializedEmbodyCore().extract_model_data_json(json(inspection.descriptor), json(serializeAnimationClips(model, animations, inspection))));
@@ -7437,12 +7434,10 @@ var Embody = class _Embody {
7437
7434
  return parse(this.core.build_clip(source.name, json2(source.input), json2(buildOptions)));
7438
7435
  case "typed":
7439
7436
  return parse(this.core.build_typed_clip(source.name, json2(source.input), json2(buildOptions)));
7440
- case "semantic":
7441
- return parse(this.core.build_semantic_clip(source.name, json2(source.input), json2(buildOptions)));
7442
7437
  case "compiled":
7443
7438
  return source.clip;
7444
7439
  case "native":
7445
- throw new Error("Native animation sources do not require semantic compilation.");
7440
+ throw new Error("Native animation sources do not require AU compilation.");
7446
7441
  }
7447
7442
  }
7448
7443
  restValues(track) {
@@ -7881,7 +7876,8 @@ var Embody = class _Embody {
7881
7876
  return this.handle(source, options, play);
7882
7877
  }
7883
7878
  buildClip(name, curves, options = {}) {
7884
- return options.semanticAnimation ? this.semanticAnimationToClip(name, options.semanticAnimation, { ...options, faceCurves: curves }) : this.build({ name, kind: "curves", input: copy(curves), options: copy(options) }, options, false);
7879
+ if (options.semanticAnimation) throw new Error("Decode legacy named animation tracks to numeric AU curves before building a clip.");
7880
+ return this.build({ name, kind: "curves", input: copy(curves), options: copy(options) }, options, false);
7885
7881
  }
7886
7882
  snippetToClip(name, curves, options = {}) {
7887
7883
  return this.buildClip(name, curves, options);
@@ -7892,9 +7888,6 @@ var Embody = class _Embody {
7892
7888
  typedSnippetToClip(name, channels, options = {}) {
7893
7889
  return this.buildTypedClip(name, channels, options);
7894
7890
  }
7895
- semanticAnimationToClip(name, animation, options = {}) {
7896
- return this.build({ name, kind: "semantic", input: copy(animation), options: copy(options) }, options, false);
7897
- }
7898
7891
  playSnippet(snippet, curvesOrOptions = {}, options = {}) {
7899
7892
  return typeof snippet === "string" ? this.buildClip(snippet, curvesOrOptions, options).play() : this.buildClip(snippet.name, snippet.curves, curvesOrOptions).play();
7900
7893
  }
@@ -8104,26 +8097,8 @@ var Embody = class _Embody {
8104
8097
  getAUBalance(id) {
8105
8098
  return this.core.get_au_balance(id);
8106
8099
  }
8107
- getBodyControls() {
8108
- return parse(this.core.get_body_controls_json());
8109
- }
8110
- getSemanticPoseCatalog() {
8111
- return parse(this.core.get_semantic_pose_catalog_json());
8112
- }
8113
- captureSemanticPose() {
8114
- return parse(this.core.capture_semantic_pose_json());
8115
- }
8116
- validateSemanticPose(pose) {
8117
- return parse(this.core.validate_semantic_pose_json(json2(pose)));
8118
- }
8119
- applySemanticPose(pose) {
8120
- this.mutateLive(() => this.core.apply_semantic_pose_json(json2(pose)));
8121
- }
8122
- validateSemanticAnimation(animation, options = {}) {
8123
- this.core.validate_semantic_animation_json(json2(animation), json2(options));
8124
- }
8125
- resetBodyControls() {
8126
- this.mutateLive(() => this.core.reset_body_controls());
8100
+ getAUDescriptors() {
8101
+ return parse(this.core.get_au_descriptors_json());
8127
8102
  }
8128
8103
  setContinuum(negative, positive, value, balance = NaN) {
8129
8104
  this.mutateLive(() => this.core.set_continuum(negative, positive, value, balance));
@@ -9984,6 +9959,6 @@ var collectMorphMeshes = (root) => {
9984
9959
  return meshes;
9985
9960
  };
9986
9961
 
9987
- 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 };
9962
+ 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 };
9988
9963
  //# sourceMappingURL=index.js.map
9989
9964
  //# sourceMappingURL=index.js.map