Skip to content

Commit ea9e4e3

Browse files
authored
Remove requirement for SuperSplat comment in PLY "chunk" element in order to decode compressed PLY format. (#39)
1 parent 7a4142c commit ea9e4e3

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/ply.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,14 +519,12 @@ export class PlyReader {
519519

520520
const elementCallback = (element: PlyElement) => {
521521
if (element.name === "chunk") {
522-
if (
523-
this.comments.some((comment) =>
524-
comment.toLowerCase().includes("supersplat"),
525-
)
526-
) {
527-
// SuperSplat compressed format detected
528-
return initSuperSplat(element);
529-
}
522+
// "chunk" could conceivably be used for other formats, and we would
523+
// ideally check for the comment: Generated by SuperSplat 2.*
524+
// but gsplat also outputs this format without such a comment.
525+
// In order to support both, let's assume a "chunk" element should
526+
// be interpreted as this format.
527+
return initSuperSplat(element);
530528
}
531529
if (isSuperSplat) {
532530
return decodeSuperSplat(element);

0 commit comments

Comments
 (0)