Skip to content

Conversation

@praveenpenumaka
Copy link
Contributor

@praveenpenumaka praveenpenumaka commented Aug 5, 2025

There is an option to generate a standalone viewer app from a .ply file in the Supersplat editor. I wanted to bring it to the splat-transform cli.

  1. The user can provide camera and target options while generating the HTML ( -a, -e )
  2. Creates a temp compressed ply to create a base64Encoded ply, which is replaced in the viewer HTML
  3. Added viewer as a submodule for inheriting viewer assets

@praveenpenumaka praveenpenumaka marked this pull request as draft August 5, 2025 15:09
@praveenpenumaka praveenpenumaka marked this pull request as ready for review August 5, 2025 15:09
@slimbuck
Copy link
Member

slimbuck commented Sep 12, 2025

Hi @praveenpenumaka!

This is very cool and actually something we've discussed doing as well.

The reason we held off is because of the nasty submodule thing being pretty nasty.

So my colleague @kpal81xd updated supersplat-viewer to publish to NPM in this PR. It means we can add the viewer as an npm dependency and access the static sources in the usual manner.

Would you like to update your PR with this approach so we can it merged? Alternatively I make the changes.

Thanks again for this and sorry it's taken so long for me to respond.

@praveenpenumaka
Copy link
Contributor Author

Hi @slimbuck,

Thank you for the response. I was also irked about the submodule.

I am glad to hear that there is a npm module instead. I can make the required changes and update the PR.

Do let me know if the approach I took seems okay. ( Creating a temp file to create viewer app )

Thanks

@slimbuck
Copy link
Member

I would probably have written the file to a memory stream somehow.

Writing to a file is probably also ok, but please place it in the os tmp dir using https://nodejs.org/api/os.html#ostmpdir or similar.

@praveenpenumaka
Copy link
Contributor Author

praveenpenumaka commented Sep 12, 2025

@slimbuck Made the required changes and verifed it now. Let me know if you need me to incorporate any more changes

@jo-chemla
Copy link

Could you make it a togglable option to either import from side companion file (sogs or ply compressed next to the index html), or to do it the way you do and embed the raw data as base64?

@praveenpenumaka
Copy link
Contributor Author

@jo-chemla You mean like a zip file with an index, CSS, JS, and model file?

@jo-chemla
Copy link

Yes, either a zip with the html/js/3dgs/css, or a directory with all these files.

I just realized your addition works as a new html output format
Would it make sense to rather add to all possible output formats, the ability to generate that html page? Either as a GLOBAL or an ACTION, eg passing the --html flag would result in generating the desired output format, with the companion html viewer.

# splat-transform input.ply output.html
splat-transform input.ply output.sog --html

@praveenpenumaka
Copy link
Contributor Author

@jo-chemla zip generation may take some time for me. will probably pick it up in a separate PR.

One the second aspect, you should be able to generate html viewer even on sog file

splat-transform output.sog output.html

Also, I think it's better if we stick to one input and one output file for now for simplicity.

@praveenpenumaka
Copy link
Contributor Author

@slimbuck i guess the current version can be merged

Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with some feedback.

praveenpenumaka and others added 4 commits September 19, 2025 14:52
@slimbuck slimbuck changed the title adds support for viewer app generation from ply Support viewer html output Sep 19, 2025
@slimbuck
Copy link
Member

Sorry it's taken so long to get back to you @praveenpenumaka .

I've pushed a few changes and I'm ready to merge - THANKS SO MUCH FOR THIS!!! <3

@slimbuck slimbuck merged commit 653276d into playcanvas:main Sep 19, 2025
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