@sage-rsc/talking-head-react 1.3.1 → 1.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-rsc/talking-head-react",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "A reusable React component for 3D talking avatars with lip-sync and text-to-speech",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -9,7 +9,8 @@
9
9
  "sideEffects": false,
10
10
  "files": [
11
11
  "dist",
12
- "src"
12
+ "src",
13
+ "scripts"
13
14
  ],
14
15
  "exports": {
15
16
  ".": {
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Generate animation manifest.json from directory structure
4
+ *
5
+ * Usage: node scripts/generate-animation-manifest.js [animations-directory]
6
+ *
7
+ * This script scans a directory for FBX files and generates a manifest.json
8
+ * that groups them by subdirectory or filename pattern.
9
+ */
10
+
11
+ import fs from 'fs';
12
+ import path from 'path';
13
+ import { fileURLToPath } from 'url';
14
+
15
+ const __filename = fileURLToPath(import.meta.url);
16
+ const __dirname = path.dirname(__filename);
17
+
18
+ const animationsDir = process.argv[2] || './public/animations';
19
+ const outputFile = path.join(animationsDir, 'manifest.json');
20
+
21
+ function scanDirectory(dir) {
22
+ const groups = {};
23
+
24
+ if (!fs.existsSync(dir)) {
25
+ console.error(`Directory does not exist: ${dir}`);
26
+ return groups;
27
+ }
28
+
29
+ const items = fs.readdirSync(dir, { withFileTypes: true });
30
+
31
+ for (const item of items) {
32
+ const fullPath = path.join(dir, item.name);
33
+
34
+ if (item.isDirectory()) {
35
+ // Scan subdirectory for FBX files
36
+ const subFiles = fs.readdirSync(fullPath)
37
+ .filter(file => file.toLowerCase().endsWith('.fbx'))
38
+ .map(file => `/animations/${item.name}/${file}`);
39
+
40
+ if (subFiles.length > 0) {
41
+ groups[item.name] = subFiles;
42
+ console.log(`Found ${subFiles.length} animations in ${item.name}/`);
43
+ }
44
+ } else if (item.isFile() && item.name.toLowerCase().endsWith('.fbx')) {
45
+ // File in root directory - add to a default group or create one
46
+ const groupName = 'default';
47
+ if (!groups[groupName]) {
48
+ groups[groupName] = [];
49
+ }
50
+ groups[groupName].push(`/animations/${item.name}`);
51
+ }
52
+ }
53
+
54
+ return groups;
55
+ }
56
+
57
+ // Generate manifest
58
+ const groups = scanDirectory(animationsDir);
59
+
60
+ const manifest = {
61
+ animations: groups,
62
+ generated: new Date().toISOString()
63
+ };
64
+
65
+ // Write manifest file
66
+ fs.writeFileSync(outputFile, JSON.stringify(manifest, null, 2));
67
+
68
+ console.log(`\nāœ… Generated manifest.json at ${outputFile}`);
69
+ console.log(`šŸ“¦ Found ${Object.keys(groups).length} animation groups:`);
70
+ Object.entries(groups).forEach(([group, files]) => {
71
+ console.log(` - ${group}: ${files.length} animations`);
72
+ });
73
+
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+ # Script to identify customizations in talkinghead.mjs
3
+
4
+ echo "=== CUSTOMIZATIONS IN talkinghead.mjs ==="
5
+ echo ""
6
+
7
+ echo "1. Position Locking Methods:"
8
+ echo "----------------------------"
9
+ grep -n "lockAvatarPosition\|unlockAvatarPosition\|maintainLockedPosition" src/lib/talkinghead.mjs | head -20
10
+ echo ""
11
+
12
+ echo "2. Bone Mapping Code:"
13
+ echo "---------------------"
14
+ grep -n "mapBoneName\|Ready Player Me\|bone mapping\|FBX bone names" src/lib/talkinghead.mjs -i | head -20
15
+ echo ""
16
+
17
+ echo "3. Position Locking Integration:"
18
+ echo "---------------------------------"
19
+ grep -n "positionWasLocked\|lockAvatarPosition\|unlockAvatarPosition" src/lib/talkinghead.mjs | head -20
20
+ echo ""
21
+
22
+ echo "4. Custom Properties:"
23
+ echo "---------------------"
24
+ grep -n "this\.lockedPosition\|this\.originalPosition\|this\.positionWasLocked" src/lib/talkinghead.mjs | head -20
25
+ echo ""
26
+
27
+ echo "=== CUSTOM FILES ==="
28
+ echo ""
29
+ echo "React Components:"
30
+ ls -1 src/components/*.jsx 2>/dev/null
31
+ echo ""
32
+ echo "Custom Config Files:"
33
+ ls -1 src/config/*.js 2>/dev/null
34
+ echo ""
35
+ echo "Custom Loaders:"
36
+ ls -1 src/lib/*FBX*.js 2>/dev/null
37
+