-
Notifications
You must be signed in to change notification settings - Fork 375
Add preview feature on export popup #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a preview feature to the export popup that allows users to preview their exported scene data using a compressed PLY file and settings cached in the browser before completing the full export process.
- Added preview button to export popup with localization support across all languages
- Implemented preview functionality that generates compressed PLY data and caches it for browser preview
- Added rollup configuration to copy the supersplat-viewer files for preview functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ui/localization.ts | Added localization strings for preview button and keyframe panel in all supported languages |
| src/ui/export-popup.ts | Added preview button to export dialog and modified option assembly functions to support preview action |
| src/file-handler.ts | Implemented preview functionality with cache storage and viewer window opening |
| rollup.config.mjs | Added configuration to copy supersplat-viewer files to preview directory |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // Previewing ply data through the cache | ||
| const cache = await caches.open(cacheName); | ||
| await cache.put('./preview/scene.compressed.ply', new Response(new Blob(plyBuffers as unknown as ArrayBuffer[], { type: 'application/octet-stream' }))); |
Copilot
AI
Oct 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type assertion as unknown as ArrayBuffer[] suggests a type mismatch. Consider verifying the actual type returned by plyWriter.close() and using proper typing instead of forcing the cast.
| await cache.put('./preview/scene.compressed.ply', new Response(new Blob(plyBuffers as unknown as ArrayBuffer[], { type: 'application/octet-stream' }))); | |
| // Ensure plyBuffers is an array of ArrayBuffer or BlobPart | |
| const blobParts = Array.isArray(plyBuffers) ? plyBuffers : [plyBuffers]; | |
| await cache.put('./preview/scene.compressed.ply', new Response(new Blob(blobParts, { type: 'application/octet-stream' }))); |
| }); | ||
|
|
||
| events.function('scene.preview', async (options) => { | ||
| const { serializeSettings, viewerExportSettings: { experienceSettings: settings } } = options; |
Copilot
AI
Oct 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Destructuring viewerExportSettings.experienceSettings assumes viewerExportSettings exists, but this field is optional in SceneExportOptions. This will throw an error when previewing non-viewer export types like PLY or Splat.
| const { serializeSettings, viewerExportSettings: { experienceSettings: settings } } = options; | |
| const { serializeSettings } = options; | |
| const settings = options.viewerExportSettings?.experienceSettings ?? {}; |
|
I think this would be nice if the preview would run in an iframe in a supersplat-dialog-box. Maybe even extend that export dialog and integrate the preview in there |
My idea is a preview method that uses scene.compressed.ply and setting.json via the cache.
demo video