This module-level variable points to the global
Sceneobject, which serves as context for all operations performed by the script. The
Sceneobject represents the program state and provides access to the contents of the visualization scene:
import ovito # Retrieve the output data of the pipeline that is currently selected in OVITO: data = ovito.scene.selected_pipeline.compute()
This module-level attribute reports the OVITO program version number (as a tuple of three ints).
This module-level attribute reports the OVITO program version (as a string).
This class encompasses all data of an OVITO program session (basically everything that gets saved in a
.ovitostate file). It provides access to the objects that are part of the three-dimensional scene.
From a script’s point of view, there exists exactly one universal instance of this class at any time, which can be accessed through the
ovito.scenemodule-level variable. A script cannot create another
The list of
Pipelineobjects that are currently part of the three-dimensional scene. Only pipelines in this list will display their output data in the viewports and in rendered images. You can add or remove a pipeline either by calling its
remove_from_scene()methods or by directly manipulating this list using standard Python
from ovito import scene from ovito.io import import_file pipeline1 = import_file('input/first_file.dump') pipeline2 = import_file('input/second_file.dump') pipeline1.add_to_scene() assert(pipeline1 in scene.pipelines) pipeline1.remove_from_scene() scene.pipelines.append(pipeline2) assert(pipeline2 in scene.pipelines) del scene.pipelines[scene.pipelines.index(pipeline2)]
Saves the scene including all data pipelines that are currently in it to an OVITO state file. This function works like the Save State As menu function of OVITO. Note that pipelines that have not been added to the scene will not be saved to the state file.
filename (str) – The output file path
The saved program state can be loaded again using the -o command line option of ovitos or in the graphical version of OVITO. After loading the state file, the
pipelineslist will contain again all
Pipelineobjects that were part of the scene when it was saved. See also here.