Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/animation/__tests__/snippetPreloader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ describe('snippetPreloader', () => {
expect(storage.removeItem).not.toHaveBeenCalled();
});

it('anchors bundled head nod snippets to the inherited live head pose', async () => {
for (const name of ['headNodSmall', 'headNodBig']) {
const resolved = await resolveSnippetEntry('speakingAnimationsList', name);
const curves = resolved?.data.curves as Record<string, Array<{ inherit?: boolean }>> | undefined;

expect(resolved?.source).toBe('bundled');
expect(curves?.['54']?.[0]).toMatchObject({ inherit: true });
expect(curves?.['53']?.[0]).toMatchObject({ inherit: true });
}
});

it('ignores legacy preloaded bundle entries when reading custom snippet names', () => {
const storage = createStorageMock({
bundledAnimationSnippetsManifest: JSON.stringify({
Expand Down
6 changes: 4 additions & 2 deletions src/animation/snippets/speaking/headNodBig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"54": [
{
"time": 0.0,
"intensity": 0.0
"intensity": 0.0,
"inherit": true
},
{
"time": 0.4,
Expand All @@ -17,7 +18,8 @@
"53": [
{
"time": 0.8,
"intensity": 0.0
"intensity": 0.0,
"inherit": true
},
{
"time": 1.4,
Expand Down
6 changes: 4 additions & 2 deletions src/animation/snippets/speaking/headNodSmall.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"54": [
{
"time": 0.0,
"intensity": 0.0
"intensity": 0.0,
"inherit": true
},
{
"time": 0.15,
Expand All @@ -17,7 +18,8 @@
"53": [
{
"time": 0.3,
"intensity": 0.0
"intensity": 0.0,
"inherit": true
},
{
"time": 0.45,
Expand Down
Loading