Skip to content

Conversation

@alexchuber
Copy link
Contributor

@alexchuber alexchuber commented Oct 29, 2025

This PR adds the glue code to enable DumpData usage in BN with the glTF exporter.

Changes:

  • Factor out core image encoding to a separate function matching NativeEncoding's own exposed function name. This follows the current nativeOverride pattern for module-level functions (see the MathHelper class.)
  • Remove the bitmaprenderer path. I initially planned for Native to polyfill this, but that turned out to be not a good idea.
  • Fix case in glTF exporter where exporting images to a specific format could lead to invalid images if the browser or platform didn't support it.

…ot assignable to type '(pixelData: Uint8Array<ArrayBufferLike>, width: number, height: number, mimeType: string, invertY: boolean, quality?: number | undefined) => Promise<...>'.

              Type 'unknown' is not assignable to type 'Promise<ArrayBuffer>'.
@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 29, 2025

@alexchuber alexchuber requested a review from bghgary October 29, 2025 20:53
@bghgary bghgary requested a review from ryantrem October 29, 2025 20:55
@bjsplat
Copy link
Collaborator

bjsplat commented Oct 30, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 30, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 30, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Oct 30, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

…sync, which doesn't exist in the core UMD build
@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 4, 2025

@alexchuber alexchuber merged commit 0af8c55 into BabylonJS:master Nov 4, 2025
20 checks passed
@alexchuber alexchuber changed the title DumpData: Add Native override DumpData: Refactor for glTF export in BN Nov 4, 2025
@alexchuber alexchuber deleted the dump-data-native branch November 4, 2025 21:40
alexchuber added a commit to BabylonJS/BabylonNative that referenced this pull request Nov 6, 2025
This PR brings NativeEncoding up to speed with the changes in [BabylonJS
#17365](BabylonJS/Babylon.js#17365). It also
updates the unit tests accordingly.

- Expect input[0] to be an ArrayBufferView, not necessarily a Uint8Array
- Include Blob in BabylonNative build
- Return Blob from EncodeImageAsync
- Don't throw on unsupported MIME type
- Use std::byte for clarity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants