GLTF Expected Run Time

Hello,

I was trying to test out the new GTLF export feature in OVITO (super cool by the way) and my OVITO just spins on “Writing scene to gLTF file”. I let it run over night and then killed it and the file was still just 48 bytes. I didn’t really expect instantaneous but I must be doing something wrong here.

I added a python script to my scene and put this line in the modify function:
export_file(None, "C:/Users/ejmei/Desktop/banana.glb", "gltf", mesh_resolution = 1)
This might not be the intended way of doing this, but OVITO doesnt seem to complain.

Hi. The indented way of exporting a scene to glTF is as follows:

pipeline = import_file(...)
pipeline.add_to_scene()
...
export_file(None, "banana.glb", "gltf", mesh_resolution = 1)

Doing the export from inside a modifier function is certainly illegal because it will easily lead to an infinite loop. That’s because export_file(None, ...) launches an evaluation of all pipelines, which is something you shouldn’t do as part of an already ongoing evaluation.
I’ll take a look at why OVITO really gets stuck. There are checks in place that are supposed to catch this kind of user mistake, but I’m not sure why they seemingly don’t work in this particular situation.

1 Like