OVITO extension to read/write vectors with all attached properties from/to a compressed numpy file or a CSV file.
The configuration of the visual element is not exported.
The vectors created in examples/example.ovito can be exported using the export file dialog selecting the "Vector file writer" format.
The resulting .npz file matches examples/example.npz. This file can be opened in OVITO Pro GUI. This reconstructs the vectors with all their properties. CSV files cannot be imported back into OVITO Pro.
Both import and export are also available from Python:
fromovito.ioimportimport_file, export_file# import npz filepipeline=import_file("examples/example.npz")
fromVectorIOimportVectorFileWriter# export npz fileexport_file(data, "examples/example.npz", format=VectorFileWriter, key=data.vectors["example_vectors"])From the OVITO Pro using the extensions GUI
OVITO Pro integrated Python interpreter:
ovitos -m pip install --user git+https://github.com/ovito-org/VectorIOThe
--useroption is recommended and installs the package in the user's site directory.Other Python interpreters or Conda environments:
pip install git+https://github.com/ovito-org/VectorIO
- Tested on OVITO version 3.12.0
Daniel Utt (utt@ovito.org)