Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
Three.js Detect if Traverse is complete

Is there a way to check if the traverse function is complete (finished traversing the scene)?

Something like (example)

fbx.traverse( function( c )
    if ( c instanceof THREE.Camera ) {      
        // Debug log camera child
        console.log( c 

}).onComplete(function( e ) {
    // Do something on complete
}

Explanation of problem: Whena user selects a FBX file, it traverses it for all cameras. If it's a valid FBX file, and successfully read, it then processes 'FBX loaded. Found ' + count + ' camera(s).'

The issue is, when I load a FBX file, I can cleary see it states "0" cameras, before the traverse has found a camera. Then it changes to 1. I'd like to know when the traverse is complete, so the user can be notified it's safe to export converted camera file.

Otherwise they may download before the traverse function is even complete.

Current Code

reader.addEventListener( "load", function( e )
    const buffer = event.target.result,
          loader = new THREE.FBXLoader(),
          fbx = loader.parse( buffer );
          
    var count = 0;
    
    fbx.traverse( function( c )
        if ( c instanceof THREE.Camera ) {      
            // Debug log camera child
            console.log( c 
            count+
    
    });
    
    msg.innerHTML = '<span class="green">FBX loaded. Found <strong>' + count + '</strong> camera(s).</span>';
    
    
});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda