GLTFExporter

class compas.files.GLTFExporter(filepath, content, embed_data=False)[source]

Bases: object

Export a glTF or glb file based on the supplied scene and ancillary data.

Parameters
  • filepath (str) – Location where the glTF or glb is to be written. The extension of the filepath determines which format will be used. If there will be an accompanying binary file, it will be written in the same directory.

  • content (GLTFContent)

  • embed_data (bool) – When True, all mesh and other data will be embedded as data uri’s in the glTF json, with the exception of external image data. When False, the data will be written to an external binary file or chunk.

Methods

export

Writes the json to .gltf or .glb, and binary data to .bin as required.

get_bin_filename

get_bin_path

load

Creates the json object and the binary data (if any) to be written.