import_gltf

Plotter.import_gltf(filename, set_camera=True)

Import a glTF file into the plotter.

See https://www.khronos.org/gltf/ for more information.

Parameters
filenamestr

Path to the glTF file.

set_camerabool, optional

Set the camera viewing angle to one compatible with the default three.js perspective ('xy').

Examples

>>> import pyvista
>>> from pyvista import examples
>>> helmet_file = examples.gltf.download_damaged_helmet()  
>>> texture = examples.hdr.download_dikhololo_night()  
>>> pl = pyvista.Plotter()  
>>> pl.import_gltf(helmet_file)  
>>> pl.set_environment_texture(cubemap)  
>>> pl.camera.zoom(1.8)  
>>> pl.show()  

See Working with a glTF Files for a full example using this method.