@sage-rsc/talking-head-react 1.3.0 ā 1.3.2
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.
|
|
3
|
+
"version": "1.3.2",
|
|
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,69 @@
|
|
|
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
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
const animationsDir = process.argv[2] || './public/animations';
|
|
15
|
+
const outputFile = path.join(animationsDir, 'manifest.json');
|
|
16
|
+
|
|
17
|
+
function scanDirectory(dir) {
|
|
18
|
+
const groups = {};
|
|
19
|
+
|
|
20
|
+
if (!fs.existsSync(dir)) {
|
|
21
|
+
console.error(`Directory does not exist: ${dir}`);
|
|
22
|
+
return groups;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const items = fs.readdirSync(dir, { withFileTypes: true });
|
|
26
|
+
|
|
27
|
+
for (const item of items) {
|
|
28
|
+
const fullPath = path.join(dir, item.name);
|
|
29
|
+
|
|
30
|
+
if (item.isDirectory()) {
|
|
31
|
+
// Scan subdirectory for FBX files
|
|
32
|
+
const subFiles = fs.readdirSync(fullPath)
|
|
33
|
+
.filter(file => file.toLowerCase().endsWith('.fbx'))
|
|
34
|
+
.map(file => `/animations/${item.name}/${file}`);
|
|
35
|
+
|
|
36
|
+
if (subFiles.length > 0) {
|
|
37
|
+
groups[item.name] = subFiles;
|
|
38
|
+
console.log(`Found ${subFiles.length} animations in ${item.name}/`);
|
|
39
|
+
}
|
|
40
|
+
} else if (item.isFile() && item.name.toLowerCase().endsWith('.fbx')) {
|
|
41
|
+
// File in root directory - add to a default group or create one
|
|
42
|
+
const groupName = 'default';
|
|
43
|
+
if (!groups[groupName]) {
|
|
44
|
+
groups[groupName] = [];
|
|
45
|
+
}
|
|
46
|
+
groups[groupName].push(`/animations/${item.name}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return groups;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Generate manifest
|
|
54
|
+
const groups = scanDirectory(animationsDir);
|
|
55
|
+
|
|
56
|
+
const manifest = {
|
|
57
|
+
animations: groups,
|
|
58
|
+
generated: new Date().toISOString()
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Write manifest file
|
|
62
|
+
fs.writeFileSync(outputFile, JSON.stringify(manifest, null, 2));
|
|
63
|
+
|
|
64
|
+
console.log(`\nā
Generated manifest.json at ${outputFile}`);
|
|
65
|
+
console.log(`š¦ Found ${Object.keys(groups).length} animation groups:`);
|
|
66
|
+
Object.entries(groups).forEach(([group, files]) => {
|
|
67
|
+
console.log(` - ${group}: ${files.length} animations`);
|
|
68
|
+
});
|
|
69
|
+
|
|
@@ -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
|
+
|