glTF rendering problem

I am trying to render to a .glb file using the python library:

from ovito.io import import_file, export_file


def main():

    data = import_file("petn.xyz")

    export_file(data, file="config.glb", format="gltf")


if __name__ == "__main__":

    main()

The .glb file that this generates is very tiny (1 KB) and it doesn’t seem to work when I load it into PowerPoint, nor the glb editor here. Am I doing something wrong? I’ve attached the .xyz file below. My Python version is 3.11.5, and my ovito library version is 3.14.1.

petn.xyz (8.0 KB)

The documentation regarding the glTF format in the export_file() function is not very comprehensive, unfortunately.

This export format is a whole scene description format, which means that this file writer outputs the current visualization scene and not individual pipelines or structures. The pipeline must therefore first be added to the scene. None should be passed to the export_file function in place of a pipeline. Otherwise, an empty scene is exported to the glTF file.

pipeline = import_file("petn.xyz")
pipeline.add_to_scene()
export_file(None, file="config.glb", format="gltf")

Worked perfectly. Thanks!