old_contents: /* global requestAnimationFrame */
  
  export async function waitForGLTFAssets(gltfObjects) {
    const remaining = [];
  
    gltfObjects.scenes.forEach(scene => {
      scene.traverse(model => {
        Object.values(model.model.program.uniforms).forEach(uniform => {
          if (uniform.loaded === false) {
            remaining.push(uniform);
          }
        });
      });
    });
  
    return await waitWhileCondition(() => remaining.some(uniform => !uniform.loaded));
  }
  
  async function waitWhileCondition(condition) {
    while (condition()) {
      await new Promise(resolve => requestAnimationFrame(resolve));
    }
  }
  
new_contents: /* global requestAnimationFrame */
  
  export async function waitForGLTFAssets(gltfObjects) {
    const remaining = [];
  
    gltfObjects.scenes.forEach(scene => {
      scene.traverse(model => {
        Object.values(model.model.uniforms).forEach(uniform => {
          if (uniform.loaded === false) {
            remaining.push(uniform);
          }
        });
      });
    });
  
    return await waitWhileCondition(() => remaining.some(uniform => !uniform.loaded));
  }
  
  async function waitWhileCondition(condition) {
    while (condition()) {
      await new Promise(resolve => requestAnimationFrame(resolve));
    }
  }
  
subject: Fix ScenegraphLayer asset wait (#4025)