@lovelace_lol/loom3 1.0.35 → 1.0.37
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 +16 -1
- package/dist/index.cjs +732 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +732 -93
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1846,6 +1846,7 @@ Loom3 can convert AU/morph curves into AnimationMixer clips for smooth, mixer-on
|
|
|
1846
1846
|
Key APIs:
|
|
1847
1847
|
- `snippetToClip(name, curves, options)` builds an AnimationClip from curves.
|
|
1848
1848
|
- `playClip(clip, options)` returns a ClipHandle you can pause/resume/stop.
|
|
1849
|
+
- `clipHandle.subscribe(listener)` streams lifecycle events from the runtime update loop.
|
|
1849
1850
|
- `clipHandle.stop()` now resolves cleanly (no rejected promise).
|
|
1850
1851
|
|
|
1851
1852
|
```typescript
|
|
@@ -1856,10 +1857,24 @@ const clip = loom.snippetToClip('gaze', {
|
|
|
1856
1857
|
|
|
1857
1858
|
if (clip) {
|
|
1858
1859
|
const handle = loom.playClip(clip, { loop: false, speed: 1 });
|
|
1860
|
+
const unsubscribe = handle?.subscribe?.((event) => {
|
|
1861
|
+
if (event.type === 'keyframe') {
|
|
1862
|
+
console.log(event.currentTime, event.keyframeIndex);
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
|
|
1859
1866
|
await handle.finished;
|
|
1867
|
+
unsubscribe?.();
|
|
1860
1868
|
}
|
|
1861
1869
|
```
|
|
1862
1870
|
|
|
1871
|
+
Clip stream events are discrete runtime events, not a polling surface:
|
|
1872
|
+
|
|
1873
|
+
- `keyframe` fires when playback crosses an authored keyframe.
|
|
1874
|
+
- `loop` fires when looping playback starts another iteration.
|
|
1875
|
+
- `seek` fires when `setTime()` scrubs the clip.
|
|
1876
|
+
- `completed` fires when non-looping playback reaches its terminal state.
|
|
1877
|
+
|
|
1863
1878
|
### Playing a snippet directly
|
|
1864
1879
|
|
|
1865
1880
|
If you already have a named snippet object, you can skip manual clip creation:
|
|
@@ -2138,7 +2153,7 @@ This is a compact reference for the public surface exported by `@lovelace_lol/lo
|
|
|
2138
2153
|
|
|
2139
2154
|
### Types and lower-level exports
|
|
2140
2155
|
|
|
2141
|
-
- Configuration/types: `Profile`, `MeshInfo`, `BlendingMode`, `TransitionHandle`, `ClipHandle`, `Snippet`, `AnimationState`, `AnimationClipInfo`.
|
|
2156
|
+
- Configuration/types: `Profile`, `MeshInfo`, `BlendingMode`, `TransitionHandle`, `ClipEvent`, `ClipEventListener`, `ClipHandle`, `Snippet`, `AnimationState`, `AnimationClipInfo`.
|
|
2142
2157
|
- Standalone implementations: `AnimationThree`, `HairPhysics`, `BLENDING_MODES`.
|
|
2143
2158
|
- Region and geometry helpers: `resolveBoneName()`, `resolveBoneNames()`, `resolveFaceCenter()`, `findFaceCenter()`, `getModelForwardDirection()`, `detectFacingDirection()`.
|
|
2144
2159
|
|