Skip to content

Commit ec6126d

Browse files
committed
Clean up.
1 parent 8605078 commit ec6126d

File tree

1 file changed

+1
-60
lines changed

1 file changed

+1
-60
lines changed

devtools/bridge.js

+1-60
Original file line numberDiff line numberDiff line change
@@ -346,36 +346,8 @@ if (!window.__THREE_DEVTOOLS__) {
346346
const message = event.data;
347347
if (!message || message.id !== 'three-devtools') return;
348348

349-
// Handle traverse request
350-
if (message.name === 'traverse' && message.uuid) {
351-
const scene = Array.from(devTools.objects.values())
352-
.find(obj => obj.uuid === message.uuid && obj.isScene);
353-
354-
if (scene) {
355-
console.log('DevTools: Re-traversing scene:', scene.uuid);
356-
// Find the actual scene object in the page
357-
const actualScene = findObjectByUUID(message.uuid);
358-
if (actualScene) {
359-
reloadSceneObjects(actualScene);
360-
}
361-
}
362-
}
363-
// Handle reload-scene request
364-
else if (message.name === 'reload-scene' && message.uuid) {
365-
console.log('DevTools: Received reload request for scene:', message.uuid);
366-
const actualScene = findObjectByUUID(message.uuid);
367-
if (actualScene) {
368-
reloadSceneObjects(actualScene);
369-
} else {
370-
console.warn('DevTools: Could not find scene for reload:', message.uuid);
371-
}
372-
}
373-
// Handle visibility toggle
374-
else if (message.name === 'visibility' && message.uuid !== undefined) {
375-
toggleVisibility(message.uuid, message.visible);
376-
}
377349
// Handle request for initial state from panel
378-
else if ( message.name === 'request-initial-state' ) {
350+
if ( message.name === 'request-initial-state' ) {
379351
for (const observedRenderer of observedRenderers) {
380352
const data = getObjectData(observedRenderer);
381353
if (data) {
@@ -447,37 +419,6 @@ if (!window.__THREE_DEVTOOLS__) {
447419
};
448420
}
449421

450-
// Add visibility toggle function
451-
function toggleVisibility(uuid, visible) {
452-
// Update our local state
453-
const obj = devTools.objects.get(uuid);
454-
if (!obj) return;
455-
456-
obj.visible = visible;
457-
console.log('DevTools: Setting visibility of', obj.type || obj.constructor.name, 'to', visible);
458-
459-
// Find the actual Three.js object using our observed scenes
460-
if (observedScenes.length > 0) {
461-
for (const scene of observedScenes) {
462-
let found = false;
463-
scene.traverse((object) => {
464-
if (object.uuid === uuid) {
465-
object.visible = visible;
466-
// If it's a light, update its helper visibility too
467-
if (object.isLight && object.helper) {
468-
object.helper.visible = visible;
469-
}
470-
found = true;
471-
console.log('DevTools: Updated visibility in scene object');
472-
}
473-
});
474-
if (found) break;
475-
}
476-
} else {
477-
console.warn('DevTools: No observed scenes found for visibility toggle');
478-
}
479-
}
480-
481422
// Function to manually reload scene objects
482423
function reloadSceneObjects(scene) {
483424
// console.log('DevTools: Manually reloading scene objects for scene:', scene.uuid);

0 commit comments

Comments
 (0)