Refactor animated PLY sequence playback with in-place frame swapping#925
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors animated PLY sequence playback so a sequence is represented by a single persistent Splat whose Gaussian data is swapped in-place per frame, preserving user-applied transforms/properties and avoiding the prior “reset scene” workflow.
Changes:
- Introduces
src/sequence.tsto manage sequence frame sources and drive a persistentSplatviaSplat.replaceData(replacing the removedsrc/ply-sequence.ts). - Adds
Splat.bindAsset/Splat.replaceDatato support in-place frame swaps with a one-frame overlap to avoid flicker and firessplat.replaced. - Updates overlay and file routing so the centers overlay reattaches after swaps and PLY sequences are routed through the new sequence manager.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/splat.ts | Refactors initial asset binding and adds replaceData for in-place frame swaps on a persistent element. |
| src/splat-overlay.ts | Listens for splat.replaced to reattach overlay after the underlying entity/instance is swapped. |
| src/sequence.ts | Adds generalized sequence playback with FrameSource + PlyFrameSource and preserves plysequence.setFrameAsync for video rendering. |
| src/ply-sequence.ts | Removes the old per-frame import/destroy-based playback implementation. |
| src/main.ts | Registers the new sequence events instead of the removed ply-sequence events. |
| src/file-handler.ts | Routes PLY sequence drops/opens to sequence.setPlyFrames. |
| src/asset-loader.ts | Extracts createGSplatAsset helper for wrapping decoded GSplatData into an engine asset/resource. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/splat.ts:291
- Splat.destroy() doesn’t release GPU resources created in bindAsset/constructor (stateTexture, transformTexture, transformPalette texture). This can leak GPU memory when splats are removed/scene cleared (and is especially noticeable with sequences that create many per-frame textures over time). Add explicit destroys before removing/unloading the asset.
super.destroy();
this.entity.destroy();
this.asset.registry.remove(this.asset);
this.asset.unload();
dimitribarbot
added a commit
to dimitribarbot/supersplat
that referenced
this pull request
Jun 26, 2026
Brings in the animated PLY sequence refactor (playcanvas#925, ply-sequence -> sequence) and the 2.28.0 release. Resolved src/main.ts: kept the fork's off-limits / portals / portals-runtime registrations and dropped the removed registerPlySequenceEvents import (the rest of the refactor auto-merged).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks how animated PLY sequences are played back on the timeline. Previously each frame recreated the entire
Splatelement (destroy + reload), so any transform applied to the model was lost on every frame change, and once the scene had been edited, scrubbing popped a "reset scene" prompt that wiped the user's work.A sequence is now a single persistent
Splatelement whose gaussian data is swapped in place per frame, so the whole-model transform and visual properties persist across frames and there's no reset prompt.Changes:
src/sequence.ts: a generalized sequence manager with aFrameSourceinterface andPlyFrameSource, owning one persistentSplatand driving it from the timeline. Replacessrc/ply-sequence.ts(removed).splat.ts: extractbindAsset; addreplaceData, which binds a frame's data onto a fresh entity that carries the current transform and keeps the previous frame on screen until the new one renders (no flicker). Firessplat.replaced.splat-overlay.ts: re-attach the centers overlay onsplat.replacedso it follows frame swaps instead of being torn down with the old entity.asset-loader.ts: addcreateGSplatAssetto wrap decodedGSplatDatainto a gsplat asset.main.ts/file-handler.ts: register the sequence manager and route PLY sequences through it.Timeline scrubbing/playback and video export (
plysequence.setFrameAsync) are preserved.