Upload log.md
Browse files
log.md
CHANGED
|
@@ -1,251 +1,87 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
Math.abs(gsWorldQuaternion.x) < 0.0001 &&
|
| 89 |
-
Math.abs(gsWorldQuaternion.y) < 0.0001 &&
|
| 90 |
-
Math.abs(gsWorldQuaternion.z) < 0.0001 &&
|
| 91 |
-
Math.abs(gsWorldQuaternion.w - 1.0) < 0.0001
|
| 92 |
-
);
|
| 93 |
-
|
| 94 |
-
if (isIdentity) {
|
| 95 |
-
console.log('[setupBoneAssignment] ✓ GS has identity rotation (no rotation applied)');
|
| 96 |
-
} else {
|
| 97 |
-
console.log('[setupBoneAssignment] ✓ GS has non-identity rotation');
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
////////////////////////////////
|
| 102 |
-
|
| 103 |
-
// Assign to filteredGs
|
| 104 |
-
filteredGs.gsQuaternion = [
|
| 105 |
-
gsWorldQuaternion.x,
|
| 106 |
-
gsWorldQuaternion.y,
|
| 107 |
-
gsWorldQuaternion.z,
|
| 108 |
-
gsWorldQuaternion.w
|
| 109 |
-
];
|
| 110 |
-
|
| 111 |
-
filteredGs.gsPosition = [
|
| 112 |
-
gsWorldPosition.x,
|
| 113 |
-
gsWorldPosition.y,
|
| 114 |
-
gsWorldPosition.z
|
| 115 |
-
];
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
/////////////////////////////////////20251210
|
| 119 |
-
|
| 120 |
-
// ========================================
|
| 121 |
-
// 2. Calculate modelScale
|
| 122 |
-
// ========================================
|
| 123 |
-
|
| 124 |
-
// ========================================
|
| 125 |
-
// 修正4: modelScaleの計算を修正
|
| 126 |
-
// Line 1929付近
|
| 127 |
-
// ========================================
|
| 128 |
-
|
| 129 |
-
console.log('[setupBoneAssignment] Step 2: Calculate modelScale');
|
| 130 |
-
|
| 131 |
-
const humanBones = character.currentVrm.humanoid.humanBones;
|
| 132 |
-
|
| 133 |
-
if (!humanBones.hips || !humanBones.hips.node) {
|
| 134 |
-
throw new Error('hips bone not found');
|
| 135 |
-
}
|
| 136 |
-
|
| 137 |
-
if (!humanBones.leftUpperLeg || !humanBones.leftUpperLeg.node) {
|
| 138 |
-
throw new Error('leftUpperLeg bone not found');
|
| 139 |
-
}
|
| 140 |
-
|
| 141 |
-
const hipsNode = humanBones.hips.node;
|
| 142 |
-
const leftUpperLegNode = humanBones.leftUpperLeg.node;
|
| 143 |
-
|
| 144 |
-
// ⭐ 修正: matrixWorldを強制的に更新
|
| 145 |
-
character.currentVrm.scene.updateMatrixWorld(true);
|
| 146 |
-
|
| 147 |
-
// Get world positions
|
| 148 |
-
const hipsWorldPos = new THREE.Vector3();
|
| 149 |
-
hipsNode.getWorldPosition(hipsWorldPos);
|
| 150 |
-
|
| 151 |
-
const leftUpperLegWorldPos = new THREE.Vector3();
|
| 152 |
-
leftUpperLegNode.getWorldPosition(leftUpperLegWorldPos);
|
| 153 |
-
|
| 154 |
-
console.log('[setupBoneAssignment] Hips world position:', {
|
| 155 |
-
x: hipsWorldPos.x.toFixed(4),
|
| 156 |
-
y: hipsWorldPos.y.toFixed(4),
|
| 157 |
-
z: hipsWorldPos.z.toFixed(4)
|
| 158 |
-
});
|
| 159 |
-
|
| 160 |
-
console.log('[setupBoneAssignment] Left upper leg world position:', {
|
| 161 |
-
x: leftUpperLegWorldPos.x.toFixed(4),
|
| 162 |
-
y: leftUpperLegWorldPos.y.toFixed(4),
|
| 163 |
-
z: leftUpperLegWorldPos.z.toFixed(4)
|
| 164 |
-
});
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
/////////////////
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
const legLength = hipsWorldPos.distanceTo(leftUpperLegWorldPos);
|
| 171 |
-
console.log('[setupBoneAssignment] Raw leg length:', legLength);
|
| 172 |
-
|
| 173 |
-
// ⭐ 判定: legLengthが0.2以下の場合、VRMスケールが正しいと判断
|
| 174 |
-
if (legLength < 0.2) {
|
| 175 |
-
console.warn('[setupBoneAssignment] ⚠️ VRM has very small leg length:', legLength);
|
| 176 |
-
console.warn('[setupBoneAssignment] Using modelScale = 1.0 (no scaling needed)');
|
| 177 |
-
gvrm.modelScale = 1.0;
|
| 178 |
-
} else {
|
| 179 |
-
// 通常の計算
|
| 180 |
-
const standardLegLength = 0.45;
|
| 181 |
-
const calculatedModelScale = standardLegLength / legLength;
|
| 182 |
-
|
| 183 |
-
console.log('[setupBoneAssignment] Calculated modelScale:', calculatedModelScale);
|
| 184 |
-
|
| 185 |
-
// 適度なクランプ
|
| 186 |
-
const clampedModelScale = Math.max(0.1, Math.min(10.0, calculatedModelScale));
|
| 187 |
-
|
| 188 |
-
if (clampedModelScale !== calculatedModelScale) {
|
| 189 |
-
console.warn('[setupBoneAssignment] ⚠️ Clamped modelScale from', calculatedModelScale, 'to', clampedModelScale);
|
| 190 |
-
}
|
| 191 |
-
|
| 192 |
-
gvrm.modelScale = clampedModelScale;
|
| 193 |
-
}
|
| 194 |
-
|
| 195 |
-
console.log('[setupBoneAssignment] ✓ Final gvrm.modelScale:', gvrm.modelScale);
|
| 196 |
-
|
| 197 |
-
///////////////////////
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
// ========================================
|
| 201 |
-
// 3. Update boneOperations (optional but recommended)
|
| 202 |
-
// ========================================
|
| 203 |
-
|
| 204 |
-
console.log('[setupBoneAssignment] Step 3: Update boneOperations');
|
| 205 |
-
|
| 206 |
-
// The current boneOperations already has the correct structure
|
| 207 |
-
// We could update rotations based on the actual pose, but it's optional
|
| 208 |
-
|
| 209 |
-
// For now, just log the current boneOperations
|
| 210 |
-
console.log('[setupBoneAssignment] Current boneOperations:', gvrm.boneOperations);
|
| 211 |
-
|
| 212 |
-
// ========================================
|
| 213 |
-
// Verification
|
| 214 |
-
// ========================================
|
| 215 |
-
|
| 216 |
-
console.log('[setupBoneAssignment] ===== TRANSFORM CALCULATION COMPLETE =====');
|
| 217 |
-
console.log('[setupBoneAssignment] Final values:');
|
| 218 |
-
console.log(' modelScale:', gvrm.modelScale);
|
| 219 |
-
console.log(' gsQuaternion:', filteredGs.gsQuaternion);
|
| 220 |
-
console.log(' gsPosition:', filteredGs.gsPosition);
|
| 221 |
-
console.log(' boneOperations:', gvrm.boneOperations.length, 'operations');
|
| 222 |
-
|
| 223 |
-
// Sanity checks
|
| 224 |
-
if (gvrm.modelScale < 0.5 || gvrm.modelScale > 2.0) {
|
| 225 |
-
console.warn('[setupBoneAssignment] ⚠️ WARNING: modelScale is outside normal range (0.5-2.0)');
|
| 226 |
-
console.warn('[setupBoneAssignment] This may cause rendering issues');
|
| 227 |
-
}
|
| 228 |
-
|
| 229 |
-
if (filteredGs.gsQuaternion[0] === 0 &&
|
| 230 |
-
filteredGs.gsQuaternion[1] === 0 &&
|
| 231 |
-
filteredGs.gsQuaternion[2] === 1 &&
|
| 232 |
-
filteredGs.gsQuaternion[3] === 0) {
|
| 233 |
-
console.warn('[setupBoneAssignment] ⚠️ WARNING: gsQuaternion is still default value!');
|
| 234 |
-
}
|
| 235 |
-
|
| 236 |
-
if (filteredGs.gsPosition[0] === 0 &&
|
| 237 |
-
filteredGs.gsPosition[1] === 0 &&
|
| 238 |
-
filteredGs.gsPosition[2] === 0) {
|
| 239 |
-
console.warn('[setupBoneAssignment] ⚠️ WARNING: gsPosition is still (0,0,0)!');
|
| 240 |
-
console.warn('[setupBoneAssignment] This means the GS has no offset from origin');
|
| 241 |
-
}
|
| 242 |
-
|
| 243 |
-
ui.setStatus('Transform calculation complete');
|
| 244 |
-
|
| 245 |
-
} catch (error) {
|
| 246 |
-
console.error('[setupBoneAssignment] ERROR in transform calculation:', error);
|
| 247 |
-
console.error('[setupBoneAssignment] Error stack:', error.stack);
|
| 248 |
-
alert('Error calculating transforms: ' + error.message);
|
| 249 |
-
throw error;
|
| 250 |
-
}
|
| 251 |
-
|
|
|
|
| 1 |
+
[preprocess_manual.js] ===== MODULE LOADING =====
|
| 2 |
+
main.js:16 [MAIN] DOMContentLoaded fired
|
| 3 |
+
main.js:269 [MAIN] Calling setupPathsFromUrlOrSelect...
|
| 4 |
+
main.js:46 [MAIN] setupPathsFromUrlOrSelect started
|
| 5 |
+
main.js:52 [MAIN] Initial paths - gsPath: undefined gvrmPath: undefined
|
| 6 |
+
main.js:55 [MAIN] No paths in URL, showing select UI
|
| 7 |
+
main.js:66 [MAIN] Elements check:
|
| 8 |
+
main.js:67 - selectContainer: true
|
| 9 |
+
main.js:68 - manualModeButton: true
|
| 10 |
+
main.js:69 - manualFileInput: true
|
| 11 |
+
main.js:117 [MAIN] Setting up file load promise
|
| 12 |
+
main.js:172 [MAIN] Setting up manual mode listeners
|
| 13 |
+
main.js:229 [MAIN] Manual mode listeners set up successfully
|
| 14 |
+
main.js:259 [MAIN] Waiting for file load promise...
|
| 15 |
+
main.js:175 [MAIN] ===== Manual mode button clicked! =====
|
| 16 |
+
main.js:178 [MAIN] Opening manual file input...
|
| 17 |
+
main.js:184 [MAIN] ===== Manual file input changed! =====
|
| 18 |
+
main.js:186 [MAIN] File object: FilelastModified: 1765861881968lastModifiedDate: Tue Dec 16 2025 14:11:21 GMT+0900 (日本標準時) {}name: "fountain_trim7.ply"size: 65171963type: ""webkitRelativePath: ""[[Prototype]]: File
|
| 19 |
+
main.js:190 [MAIN] Manual file selected: fountain_trim7.ply Extension: ply
|
| 20 |
+
main.js:198 [MAIN] Reading manual file...
|
| 21 |
+
main.js:201 [MAIN] Manual file read complete, size: 65171963
|
| 22 |
+
main.js:209 [MAIN] Manual mode file loaded: fountain_trim7.ply
|
| 23 |
+
main.js:210 [MAIN] gsPath: blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056
|
| 24 |
+
main.js:211 [MAIN] gsFileName: fountain_trim7.ply
|
| 25 |
+
main.js:110 [MAIN] Hiding select UI
|
| 26 |
+
main.js:215 [MAIN] ===== Resolving with MANUAL MODE =====
|
| 27 |
+
main.js:261 [MAIN] File load promise resolved: ObjectgsPath: "blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056"gvrmPath: undefinedmanualMode: true[[Prototype]]: Object
|
| 28 |
+
main.js:271 [MAIN] setupPathsFromUrlOrSelect returned: ObjectgsPath: "blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056"gvrmPath: undefinedmanualMode: true[[Prototype]]: Object
|
| 29 |
+
main.js:277 [MAIN] After pathResult:
|
| 30 |
+
main.js:278 - gsPath: blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056
|
| 31 |
+
main.js:279 - gvrmPath: undefined
|
| 32 |
+
main.js:280 - isManualMode: true
|
| 33 |
+
main.js:283 [MAIN] Initializing renderer...
|
| 34 |
+
main.js:289 [MAIN] Initializing camera...
|
| 35 |
+
main.js:316 [MAIN] Initializing scene...
|
| 36 |
+
main.js:323 [MAIN] Three.js initialization complete
|
| 37 |
+
main.js:506 [MAIN] Processing GS file: blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056
|
| 38 |
+
main.js:507 [MAIN] Manual mode: true
|
| 39 |
+
main.js:519 [MAIN] fileName: fountain_trim7.gvrm
|
| 40 |
+
main.js:529 [MAIN] ===== STARTING MANUAL PREPROCESSING MODE =====
|
| 41 |
+
main.js:530 [MAIN] Parameters:
|
| 42 |
+
main.js:531 - vrmPath: ./assets/sotai.vrm
|
| 43 |
+
main.js:532 - gsPath: blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056
|
| 44 |
+
main.js:533 - fileName: fountain_trim7.gvrm
|
| 45 |
+
preprocess_manual.js:977 [preprocessManual] ===== FUNCTION CALLED =====
|
| 46 |
+
preprocess_manual.js:978 [preprocessManual] Parameters:
|
| 47 |
+
preprocess_manual.js:979 vrmPath: ./assets/sotai.vrm
|
| 48 |
+
preprocess_manual.js:980 gsPath: blob:http://127.0.0.1:5500/ec6dfe0b-7d8a-446e-aa8b-c717ac15a056
|
| 49 |
+
preprocess_manual.js:981 fileName: fountain_trim7.gvrm
|
| 50 |
+
preprocess_manual.js:984 [preprocessManual] Creating Promise...
|
| 51 |
+
preprocess_manual.js:84 [createManualUI] Creating manual preprocessing UI...
|
| 52 |
+
preprocess_manual.js:988 [preprocessManual] UI created
|
| 53 |
+
preprocess_manual.js:435 [ManualUI] initialize called
|
| 54 |
+
main.js:541 [MAIN] preprocessManual called, waiting for promise...
|
| 55 |
+
preprocess_manual.js:991 [preprocessManual] UI initialized, starting manual process...
|
| 56 |
+
preprocess_manual.js:1005 [preprocessManual] PLY loaded: 262784 vertices
|
| 57 |
+
preprocess_manual.js:1011 [preprocessManual] ===== ANALYZING PLY COORDINATE SYSTEM =====
|
| 58 |
+
preprocess_manual.js:1026 [PCA] Center: Objectx: -0.2652678845128372y: 1.1990953609667259z: 0.923559379148402[[Prototype]]: Object
|
| 59 |
+
preprocess_manual.js:1052 [PCA] Covariance matrix: Objectcxx: "0.38"cxy: "0.18"cxz: "0.09"cyy: "1.10"cyz: "1.00"czz: "1.24"[[Prototype]]: Object
|
| 60 |
+
preprocess_manual.js:1067 [PCA] Variance ratios: Objectx: "14.0%"y: "40.4%"z: "45.6%"[[Prototype]]: Object
|
| 61 |
+
preprocess_manual.js:1080 [PCA] Is aligned with world axes: false
|
| 62 |
+
preprocess_manual.js:1113 [preprocessManual] ===== STARTING AUTO-ALIGNMENT =====
|
| 63 |
+
preprocess_manual.js:1117 [DEBUG] Original vertices reference: Array(262784)
|
| 64 |
+
preprocess_manual.js:1118 [DEBUG] Original first vertex: Objectx: "-0.738219"y: "0.244090"z: "0.748940"[[Prototype]]: Object
|
| 65 |
+
preprocess_manual.js:1127 [preprocessManual] Step 1: Calculating center of mass...
|
| 66 |
+
preprocess_manual.js:1142 [DEBUG] Center of mass: Objectx: "-0.265268"y: "1.199095"z: "0.923559"[[Prototype]]: Object
|
| 67 |
+
preprocess_manual.js:1148 [DEBUG] First vertex BEFORE centering: Objectx: "-0.738219"y: "0.244090"z: "0.748940"[[Prototype]]: Object
|
| 68 |
+
preprocess_manual.js:1157 [preprocessManual] Step 2: Centering PLY (in-place modification)...
|
| 69 |
+
preprocess_manual.js:1166 [DEBUG] First vertex AFTER centering: Objectx: "-0.472951"y: "-0.955005"z: "-0.174620"[[Prototype]]: Object
|
| 70 |
+
preprocess_manual.js:1173 [DEBUG] Vertices reference after centering: Array(262784)
|
| 71 |
+
preprocess_manual.js:1174 [DEBUG] Is same reference? true
|
| 72 |
+
preprocess_manual.js:1179 [preprocessManual] Step 3: Verifying centering...
|
| 73 |
+
preprocess_manual.js:1192 [DEBUG] Average after centering: Objectx: "-0.000000000"y: "0.000000000"z: "0.000000000"[[Prototype]]: Object
|
| 74 |
+
preprocess_manual.js:1208 [DEBUG] ✓ Centering SUCCESS! Average is effectively zero
|
| 75 |
+
preprocess_manual.js:1209 [preprocessManual] ✓ PLY centered at origin
|
| 76 |
+
preprocess_manual.js:1214 [preprocessManual] Step 4: Calculating bounding box...
|
| 77 |
+
preprocess_manual.js:1217 [DEBUG] First 3 vertices before bbox calculation:
|
| 78 |
+
preprocess_manual.js:1219 V0: Objectx: "-0.472951"y: "-0.955005"z: "-0.174620"[[Prototype]]: Object
|
| 79 |
+
preprocess_manual.js:1219 V1: Objectx: "-0.443478"y: "-0.990319"z: "-0.194779"[[Prototype]]: Object
|
| 80 |
+
preprocess_manual.js:1219 V2: Objectx: "-0.336042"y: "-0.721272"z: "-0.803300"[[Prototype]]: Object
|
| 81 |
+
preprocess_manual.js:1245 [preprocessManual] Bounding box: Objectcenter: {x: '1.205513', y: '-1.566416', z: '0.215589'}max: {x: '3.545', y: '2.136', z: '2.193'}min: {x: '-1.134', y: '-5.269', z: '-1.762'}[[Prototype]]: Object
|
| 82 |
+
preprocess_manual.js:1259 [preprocessManual] ✓ Bounding box center is at origin
|
| 83 |
+
preprocess_manual.js:1260 [preprocessManual] Size: Objectx: "4.680"y: "7.404"z: "3.955"[[Prototype]]: Object
|
| 84 |
+
preprocess_manual.js:1269 [preprocessManual] ✓ PLY is properly centered
|
| 85 |
+
preprocess_manual.js:1273 [preprocessManual] ===== AUTO-ALIGNMENT COMPLETE =====
|
| 86 |
+
preprocess_manual.js:1279 Uncaught (in promise) ReferenceError: finalCenter is not defined
|
| 87 |
+
at preprocess_manual.js:1279:14
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|