-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_console.js
More file actions
77 lines (65 loc) · 2.87 KB
/
Copy pathdebug_console.js
File metadata and controls
77 lines (65 loc) · 2.87 KB
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
// Debug script - paste this into browser console
console.clear();
console.log('🔍 DEBUGGING UNIFORM CONFIGURATOR');
console.log('=================================');
// Check if app exists
if (window.uniformConfigurator) {
const app = window.uniformConfigurator;
console.log('✅ App found:', app);
// Check base texture
console.log('📷 Base texture image:', app.baseTextureImage);
// Check managers
console.log('🎬 Scene Manager:', app.sceneManager);
console.log('🎨 Layer Manager:', app.layerManager);
console.log('🖥️ UI Manager:', app.uiManager);
// Check 3D model
if (app.sceneManager) {
console.log('🎯 3D Model loaded:', !!app.sceneManager.model);
console.log('🎯 Scene material:', app.sceneManager.material);
console.log('🎯 Scene renderer:', !!app.sceneManager.renderer);
}
// Check texture system
if (app.layerManager) {
console.log('🎨 Texture canvas:', app.layerManager.textureCanvas);
console.log('🎨 Current texture:', app.layerManager.texture);
console.log('🎨 Layers count:', app.layerManager.layers.length);
console.log('🎨 Current layers:', app.layerManager.layers);
}
// Test texture creation
console.log('\n🧪 TESTING TEXTURE CREATION...');
if (app.layerManager && app.layerManager.textureCanvas) {
const canvas = app.layerManager.textureCanvas;
console.log('Canvas dimensions:', canvas.width, 'x', canvas.height);
// Try to add a test layer
console.log('Adding test text layer...');
try {
const layer = app.layerManager.addTextLayer('DEBUG TEST');
console.log('Test layer added:', layer);
// Check if texture updated
setTimeout(() => {
console.log('Texture after test layer:', app.layerManager.texture);
console.log('Texture needsUpdate:', app.layerManager.texture?.needsUpdate);
}, 500);
} catch (error) {
console.error('❌ Error adding test layer:', error);
}
}
} else {
console.log('❌ window.uniformConfigurator not found');
console.log('Available globals:', Object.keys(window).filter(k => k.includes('uniform') || k.includes('config')));
}
// Check for error messages in DOM
const errorElements = document.querySelectorAll('[data-error], .error, .notification');
console.log('🚨 Error elements found:', errorElements.length);
errorElements.forEach((el, i) => {
console.log(`Error ${i}:`, el.textContent, el);
});
// Check initialization errors
console.log('\n🔍 CHECKING FOR INITIALIZATION ERRORS...');
console.log('Document ready state:', document.readyState);
// Monitor console for errors
const originalError = console.error;
console.error = function(...args) {
console.log('🚨 CONSOLE ERROR CAUGHT:', args);
originalError.apply(console, args);
};