Skip to content

fix: forward fileType to SplatLoader in PackedSplats.asyncInitialize#283

Open
zzha9494 wants to merge 1 commit intosparkjsdev:mainfrom
zzha9494:fix/packed-splats-file-type
Open

fix: forward fileType to SplatLoader in PackedSplats.asyncInitialize#283
zzha9494 wants to merge 1 commit intosparkjsdev:mainfrom
zzha9494:fix/packed-splats-file-type

Conversation

@zzha9494
Copy link
Copy Markdown

@zzha9494 zzha9494 commented Mar 11, 2026

Fixes #233

Bug: When constructing a SplatMesh with url + fileType, the fileType is never forwarded to the internal SplatLoader instance created in PackedSplats.asyncInitialize(). This causes URLs without recognizable extensions (e.g. Blob URLs) to fail with Unknown splat file type: undefined.

Fix: Add loader.fileType = options.fileType before calling loader.loadAsync(url).

When using a URL without a recognizable file extension (e.g. blob URLs), the fileType option passed to SplatMesh/PackedSplats was not forwarded to the internal SplatLoader instance, causing 'Unknown splat file type' error.
@dmarcos
Copy link
Copy Markdown
Contributor

dmarcos commented Mar 12, 2026

Thanks so much. Is this an issue in the 2.0.0 branch: https://github.com/sparkjsdev/spark/tree/v2.0.0-preview ?

@zzha9494
Copy link
Copy Markdown
Author

I tried 2.0.0 branch. This code does not work:
const splats = new SplatMesh({ fileBytes: arrayBuffer, fileType: "sogs", });

However, in 0.1.10, this code works (mesh rendered):
const splats = new SplatMesh({ fileBytes: arrayBuffer, fileType: SplatFileType.PCSOGSZIP, });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants