From 3b2754790ac2a7febacf1f043acf81539317b6da Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Sat, 18 May 2024 18:51:12 +0100 Subject: [PATCH 1/2] Associate PLY file with the SuperSplat PWA --- package.json | 6 +++--- src/main.ts | 19 ++++++++++++++++++- src/manifest.json | 10 +++++++++- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1eceb9b..5eff725 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "super-splat", + "name": "supersplat", "version": "0.16.0", "author": "PlayCanvas", - "homepage": "https://playcanvas.com/super-splat", - "description": "All the splat things", + "homepage": "https://playcanvas.com/supersplat/editor", + "description": "3D Gaussian Splat Editor", "keywords": [ "playcanvas", "ply", diff --git a/src/main.ts b/src/main.ts index e637866..e831a91 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,7 +17,14 @@ import { Events } from './events'; import { PickerSelection } from './tools/picker-selection'; declare global { + interface LaunchParams { + readonly files: FileSystemFileHandle[]; + } + interface Window { + launchQueue: { + setConsumer: (callback: (launchParams: LaunchParams) => void) => void; + }; scene: Scene; showError: (err: string) => void; } @@ -189,6 +196,16 @@ const main = async () => { } window.scene = scene; -} + + // handle OS-based file association in PWA mode + if ("launchQueue" in window) { + window.launchQueue.setConsumer(async (launchParams: LaunchParams) => { + for (const file of launchParams.files) { + const blob = await file.getFile(); + scene.loadModel(URL.createObjectURL(blob), file.name); + } + }); + } +}; export { main }; diff --git a/src/manifest.json b/src/manifest.json index 1603672..694d1d1 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -30,5 +30,13 @@ "sizes": "3840x2160", "form_factor": "wide" } - ] + ], + "file_handlers": [ + { + "action": "/", + "accept": { + "application/ply": [".ply"] + } + } + ] } From b714eae8a433e755965078cb553f224ade7c1c0f Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Sat, 18 May 2024 19:03:27 +0100 Subject: [PATCH 2/2] Remove space from SUPER SPLAT --- src/ui/control-panel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/control-panel.ts b/src/ui/control-panel.ts index 451ff86..7dbedd6 100644 --- a/src/ui/control-panel.ts +++ b/src/ui/control-panel.ts @@ -5,7 +5,7 @@ import { version as supersplatVersion } from '../../package.json'; class ControlPanel extends Panel { constructor(events: Events, remoteStorageMode: boolean, args = { }) { Object.assign(args, { - headerText: `SUPER SPLAT v${supersplatVersion}`, + headerText: `SUPERSPLAT v${supersplatVersion}`, id: 'control-panel', resizable: 'right', resizeMax: 1000,