Mr.doob 7 месяцев назад
Родитель
Сommit
409e2cdb25
1 измененных файлов с 8 добавлено и 17 удалено
  1. 8 17
      devtools/bridge.js

+ 8 - 17
devtools/bridge.js

@@ -409,21 +409,20 @@
 
 		}
 
-		function sendObjectDetails( uuid ) {
+		function findObjectInScenes( uuid ) {
 
-			// Find the object with the given UUID
-			const findObjectInScenes = ( targetUuid ) => {
+			for ( const scene of observedScenes ) {
 
-				for ( const scene of observedScenes ) {
+				const found = scene.getObjectByProperty( 'uuid', uuid );
+				if ( found ) return found;
 
-					const found = scene.getObjectByProperty( 'uuid', targetUuid );
-					if ( found ) return found;
+			}
 
-				}
+			return null;
 
-				return null;
+		}
 
-			};
+		function sendObjectDetails( uuid ) {
 
 			const object = findObjectInScenes( uuid );
 
@@ -452,10 +451,6 @@
 
 				dispatchEvent( 'object-details', details );
 
-			} else {
-
-				console.warn( 'DevTools: Object not found for UUID:', uuid );
-
 			}
 
 		}
@@ -482,10 +477,6 @@
 					renderer.domElement.style.outline = originalOutline;
 				}, 1000 );
 
-			} else {
-
-				console.warn( 'DevTools: Renderer or canvas element not found for UUID:', rendererUuid );
-
 			}
 
 		}

粤ICP备19079148号