{"record":{"id":"ba8786793e0589ce","repo":"Comfy-Org/ComfyUI","slug":"file3dtosplat-unsupported-ply-format-p-1-ne","errorCode":null,"errorMessage":"File3DToSplat: unsupported PLY format '{p[1]}' (need binary_little_endian)","messagePattern":"File3DToSplat: unsupported PLY format '(.+?)' \\(need binary_little_endian\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_gaussian_splat.py","lineNumber":224,"sourceCode":"\ndef _norm_quat(q):\n    return q / np.linalg.norm(q, axis=1, keepdims=True).clip(1e-12)\n\n\ndef _parse_ply_gaussian(data: bytes):\n    end = data.find(b'end_header')\n    if end < 0:\n        raise ValueError(\"File3DToSplat: not a PLY (missing end_header)\")\n    header = data[:end].decode('ascii', 'replace')\n    body = end + len(b'end_header')\n    body += 2 if data[body:body + 2] == b'\\r\\n' else 1\n    count, props, in_vertex = 0, [], False\n    for line in header.splitlines():\n        p = line.split()\n        if not p:\n            continue\n        if p[0] == 'format' and p[1] != 'binary_little_endian':\n            raise ValueError(f\"File3DToSplat: unsupported PLY format '{p[1]}' (need binary_little_endian)\")\n        if p[0] == 'element':\n            in_vertex = p[1] == 'vertex'\n            if in_vertex:\n                count = int(p[2])\n        elif p[0] == 'property' and in_vertex:\n            if p[1] == 'list':\n                raise ValueError(\"File3DToSplat: PLY vertex has list properties (unsupported)\")\n            props.append((p[2], '<' + _PLY_DTYPES[p[1]]))\n    arr = np.frombuffer(data, np.dtype(props), count=count, offset=body)\n    names = arr.dtype.names\n    c = lambda k: arr[k].astype(np.float32)\n    n = count\n\n    xyz = np.stack([c('x'), c('y'), c('z')], 1)\n    if 'scale_0' in names:\n        scale = np.exp(np.stack([c('scale_0'), c('scale_1'), c('scale_2')], 1))   # 3DGS stores log scale\n    else:\n        scale = np.full((n, 3), 0.01, np.float32)","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_gaussian_splat.py#L206-L242","documentation":"Raised by _parse_ply_gaussian when the PLY header's format line is not binary_little_endian. The parser uses a single numpy structured read (np.frombuffer with packed little-endian dtypes), so it only supports the binary_little_endian encoding. ASCII PLYs and big-endian binary PLYs are rejected with this message.","triggerScenarios":"File3DToSplat on a PLY saved as 'format ascii 1.0' (common output of mesh tools like MeshLab exports or hand-edited files) or 'format binary_big_endian 1.0' (rare, some old scanners/Big-endian platforms).","commonSituations":"Exporting a gaussian PLY from a tool that defaults to ASCII; converting mesh PLYs from CAD/scanner software that writes big-endian; assuming any .ply is 3DGS-compatible when it is a plain mesh export.","solutions":["Re-export/convert the file to binary_little_endian (e.g., with plyfile in Python or a converter that preserves vertex properties).","If you have the source tool, change its PLY export settings to binary/little-endian.","For ASCII files, convert once via a script: parse ASCII, rewrite binary little-endian with the same vertex properties."],"exampleFix":"# convert ascii ply to binary_little_endian with plyfile\nfrom plyfile import PlyData\nply = PlyData.read('model_ascii.ply')\nply.write('model_bin.ply')  # plyfile defaults to binary little-endian","handlingStrategy":"validation","validationCode":"header = data[:data.find(b'end_header')].decode('ascii', 'replace')\nif 'format binary_little_endian' not in header:\n    raise ValueError('PLY must be binary_little_endian; convert before loading')","typeGuard":"def is_bile_ply(data: bytes) -> bool:\n    end = data.find(b'end_header')\n    return end > 0 and 'format binary_little_endian' in data[:end].decode('ascii', 'replace')","tryCatchPattern":"try:\n    result = _parse_ply_gaussian(data)\nexcept ValueError as e:\n    if 'unsupported PLY format' in str(e):\n        convert_to_binary_little_endian(path)  # e.g. via plyfile\n    else:\n        raise","preventionTips":["Configure exporters to write binary (little-endian) PLY, not ASCII.","Standardize on the 3DGS PLY layout (x/y/z, scale_*, rot_*, opacity, f_dc_*) when producing files."],"tags":["gaussian-splatting","ply","file-format","endianness"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}