Validation workaround `wait-for-import`: snippets don't await mesh/NodeMaterial loads

Open
#2,009 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@bkaradzic-microsoft is already working on this.

Since Nov 3, 2026.

Assessment

This issue has not been assessed yet.

Description

Affected tests (7)

  • NME Glow Manual
  • OpenPBR Transmission Color glTF - Analytic Lights
  • OpenPBR Transmission Roughness vs IOR - Analytic Lights
  • OpenPBR Transmission Scatter Anisotropy Reflect - Analytic Lights
  • OpenPBR Subsurface Radius vs Anisotropy - Analytic Lights
  • OpenPBR Thin Walled Anisotropic Transmission - Analytic Lights
  • OpenPBR Thin Walled Subsurface Anisotropy - Analytic Lights

What the workaround does

Waits for pending ImportMeshAsync / NodeMaterial.ParseFromSnippetAsync / ParseFromFileAsync calls before capture. The snippets fire these without awaiting and NodeMaterial loads don't register scene pending data, so executeWhenReady can fire before the content exists. Introduced in #1872.

Recommended fix

Fix in Babylon.js: NodeMaterial snippet/file loading (and any other async loaders used here) should call scene.addPendingData / removePendingData so scene readiness waits for them. Alternatively fix the snippets to await their loads (update both Babylon.js and BN config.json; references stay valid).


Workaround implementations live in Apps/Playground/Scripts/validation_native.js (WORKAROUNDS map); tests opt in via the workarounds array in Apps/Playground/Scripts/config.json. See Documentation/AddingNewValidationTests.md.

Dominant language
C++
Stars
931
Forks
169
Avg merge
2d 17h
Merged PRs (30d)
66

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BabylonJS/BabylonNative

All issues in BabylonJS/BabylonNative

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.